As this is a header we’re including, there is nothing we can do about this, so reporting it on our line of sourece code isnt useful. In addition the bson library is C, not C++, so it cant use nullptr either.
And these are defined within extern "C" { .. } which should turn off this C++ suggestion on a C macro.
You are right about the false-positive with extern C. I created a ticket to fix it.
For the part of raising an issue on an external macro, I wasn’t able to reproduce it. Can you provide an example or generate an automatic reproducer.
I tried this example and it didn’t raise an issue:
Add the reproducer option to the scanner configuration:
sonar.cfamily.reproducer= “Full path to the .cpp file that has or include the file that has the false-positive”
Re-run the scanner to generate a file named sonar-cfamily.reproducer in the project folder.
Please share this file. if you think this file contains private information you can send it privately.