sonar-cxx icon indicating copy to clipboard operation
sonar-cxx copied to clipboard

Handle unknown MAROs more tolerant

Open guwirth opened this issue 7 years ago • 1 comments

Handle unknown MACOSs more tolerant in case of string concatenation. In case not all headers are available this should be handled without syntax error.

In case below MACRO could be e.g. replaced by blank:

    string Getter() const
    {
         return "aaa" MACRO "bbb";
    }

guwirth avatar Mar 26 '19 14:03 guwirth

Idea:

 "aaa" MACRO "bbb"

is after preprocessing

 "aaa" 0 "bbb"

Add a special case for string concatenation?

guwirth avatar May 28 '22 10:05 guwirth

The string concatenation takes place in the preprocessor. However, not all type information is available here in order to be able to react correctly in the event of an error.

There are also cases like encoding prefixes which has to be taken into account: L"Δx = %" PRId16.

Not solvable in the preprocessor.

guwirth avatar Jan 24 '23 06:01 guwirth