Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pragma message in Clang?

What's Clang's equivalent to #pragma message as used in GCC and MSVC?

like image 493
Matt Joiner Avatar asked Sep 26 '10 07:09

Matt Joiner


People also ask

Does clang support pragma?

Clang supports GCC's pragma for compatibility with existing source code, as well as several extensions. In addition to all of the functionality provided by GCC's pragma, Clang also allows you to push and pop the current warning state.

What is pragma message?

A typical use of the message pragma is to display informational messages at compile time. The message-string parameter can be a macro that expands to a string literal, and you can concatenate such macros with string literals in any combination.

Does GCC support pragma message?

GCC keeps track of the location of each pragma, and issues diagnostics according to the state as of that point in the source file. Thus, pragmas occurring after a line do not affect diagnostics caused by that line.

What is cc1 clang?

clang -cc1 is the frontend, clang is the driver. The driver invokes the frontend with options appropriate for your system. To see these options, run: $ clang -### -c hello.c. Some clang command line options are driver-only options, some are frontend-only options.


1 Answers

I've brought this up on the Clang mailing list, and it's in discussion now. It's subsequently been implemented as a warning, and hopefully soon it will be behave as it does in other compilers.

like image 169
Matt Joiner Avatar answered Sep 23 '22 02:09

Matt Joiner