r179771 - Dropped the parentheses for #pragma message and its kin in the -E output generator.
Andy Gibbs
andyg1001 at hotmail.co.uk
Thu Apr 18 11:54:37 PDT 2013
On Thursday, April 18, 2013 8:10 PM, Jordan Rose wrote:
> No, that's not correct either. Microsoft's #pragma message requires
> parens, while #pragma GCC (error|warning) apparently requires no
> parens. (GCC's #pragma message seems to be MS-inspired, as it has no
> GCC namespace and optionally allows parens.)
>
> http://msdn.microsoft.com/en-us/library/x7dkzch2(v=vs.80).aspx
> http://gcc.gnu.org/onlinedocs/cpp/Pragmas.html
> http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html
I admit I did miss the bit where MS requires the parenthesis (I'm not
completely sure this is the case, actually, but I haven't got access to
an MS compiler just now to check).
Regarding #pragma message, I think gcc has made this deprecated since
they don't have a #pragma GCC message variant and their documentation
states that those not moved forward to the new format are henceforth
deprecated. This is an excerpt from the gcc docs:
"For backward compatibility, pragmas which were recognized by
previous versions are still recognized without the GCC prefix, but
that usage is deprecated. Some older pragmas are deprecated in their
entirety. They are not recognized with the GCC prefix."
Also, although this is an aside, clang doesn't support #pragma
message in a 100% compatible way since clang technically makes the
message a warning, which is not the case either on MS (again this is
from memory) or gcc.
> I'm okay with not really striving for source fidelity here; since
> there's no #pragma GCC message, it's probably safe to just
> parenthesize message all the time.
So... I'll roll back that particular change, shall I? I don't think
there is much advantage to passing down whether the #pragma was
parenthesized or not -- additional overhead for negligible gain IMHO.
Cheers,
Andy
More information about the cfe-commits
mailing list