This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Tue, 22 Jul 2008, Diego Novillo wrote:
On Fri, Jul 18, 2008 at 10:18, Simon Baldwin <simonb@google.com> wrote:
+ static voidNeeds comment.
+ handle_pragma_message (cpp_reader *ARG_UNUSED(dummy))
+ {
+ if (TREE_STRING_LENGTH (message) > 1)
+ fnotice (stdout, "%s\n", TREE_STRING_POINTER (message));
Shouldn't this go to stderr? Or are you purposely separating these messages from warning/errors.
The idea and the patch are fine with me. I would be overstepping my
maintenance bounds if I approved it, though. Joseph, could you
comment on this patch?
Not only should it go to stderr, it should go through the diagnostic machinery, and be properly labelled to distinguish it from normal diagnostics. I suggest inform ("#pragma message: %s", message_text) to make it clear that the diagnostic is coming from this pragma.
In addition, I believe TREE_STRING_POINTER will be in the execution character set here, not the source character set or the locale character set. For diagnostics, you should in principle convert to the locale character set (it may be necessary to export some suitable conversion interface from libcpp) - though given other existing bugs in this area this isn't critical.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |