Unsolved Should I report a bug ?
-
I have this odd behavior of text enclosed in
#ifdef BYPASS
....
While I've been programming
....
#endifcompiler complains about "missing terminating character " in highlighted / bold snippet. It does NOT ignore " ' " . Why?
-
@AnneRanch
sure, this isnt C++ -
@raven-worx said in Should I report a bug ?:
@AnneRanch
sure, this isnt C++To whom ( the bell tools ) ?
preprocessor r forum ? -
@AnneRanch
but the line containing the error is not C++, thus an error is expected.It does NOT ignore " ' " . Why?
why do you expect it to be ignored?
show the whole snippet of code please. -
@raven-worx said in Should I report a bug ?:
@AnneRanch
but the line containing the error is not C++, thus an error is expected.It does NOT ignore " ' " . Why?
why do you expect it to be ignored?
show the whole snippet of code please.Are you familiar with preprocessor directives?
They have been integral part of C since its conception.
If you are not (familiar with preprocessor ) , how posting the entire several hundreds lines of text will help (you) to understand the issue ?#ifdef BYPASS
do not process what is inside here
unless BYPASS is define(d)
that should include " ' "#endif
-
@AnneRanch said in Should I report a bug ?:
Are you familiar with preprocessor directives?
I suspect @raven-worx is perfectly familiar with C, C++, preprocessors and other such :)
that should include " ' "
No. C++ preprocessor tokenizes input. This is different from the old C preprocessor behaviour. You can't assume everything is identical. It looks for
"
(double-quote) as potential strings but also'
(single-quote) as potential literal character sequences. These could be unterminated.You could read:
https://gcc.gnu.org/onlinedocs/cpp/Tokenization.html#Tokenization
https://gcc.gnu.org/onlinedocs/cpp/Traditional-lexical-analysis.html#Traditional-lexical-analysisYou seem to have a single single-quote on a line. You are likely to have that reported as "an unterminated character". It is perhaps a warning rather than error. Behaviour varies by compiler.
Needless to say, this is from whatever C++ compiler you are using. Nothing to do with Qt or Creator. I don't know who you have in mind for reporting a bug to.
One online compiler (gcc):
// Example program int main() { #ifdef UNUSED Ignore this but can't have this single quote #endif }
generates compiler warning:
6:8: warning: missing terminating ' character
You can look at it via https://godbolt.org/z/Px9WanYWW
Commenting your "free text" lines by
// ...
would avoid the problem. -
@AnneRanch said in Should I report a bug ?:
Are you familiar with preprocessor directives?
They have been integral part of C since its conception.
If you are not (familiar with preprocessor ) , how posting the entire several hundreds lines of text will help (you) to understand the issue ?yes i am familiar with this concept, thank you,
Nevertheless everything inside conditional preprocessor directives must be valid C++, which arbitrary text is not.I asked for a bigger snippet to get an idea where and how your noted text is used exactly.
-
@AnneRanch
Are you happy with the definitive answers you got here?
Are you going to mark this topic as solved?
Or just ignore everything?