Patchwork include macro name in "ISO C99 requires rest arguments to be used"

login
register
mail settings
Submitter Roland McGrath
Date July 28, 2010, 9:20 p.m.
Message ID <20100728212014.1E5D9400DE@magilla.sf.frob.com>
Download mbox | patch
Permalink /patch/60177/
State New
Headers show

Comments

Roland McGrath - July 28, 2010, 9:20 p.m.
The libcpp -pedantic warning "ISO C99 requires rest arguments to be used"
does not say which macro it refers to, which can make it harder than
necessary to navigate a deep nest of macros to find the problem.
Include the macro name in the error message.


Thanks,
Roland


libcpp/
2010-07-28  Roland McGrath  <roland@redhat.com>

	* macro.c (_cpp_arguments_ok): Include macro name in -pedantic warning.
Tom Tromey - Sept. 10, 2010, 10:31 p.m.
>>>>> "Roland" == Roland McGrath <roland@redhat.com> writes:

Roland> The libcpp -pedantic warning "ISO C99 requires rest arguments to
Roland> be used" does not say which macro it refers to, which can make
Roland> it harder than necessary to navigate a deep nest of macros to
Roland> find the problem.  Include the macro name in the error message.

I didn't see a reply to this.

Sorry for the delay on this, it got buried.

Roland> 2010-07-28  Roland McGrath  <roland@redhat.com>
Roland> 	* macro.c (_cpp_arguments_ok): Include macro name in -pedantic warning.

This is ok.  You didn't mention whether you regtested it, but I assume so.
If not, and it needs test suite fixes, those are ok too.
 
Tom
Roland McGrath - Sept. 10, 2010, 10:47 p.m.
> This is ok.  You didn't mention whether you regtested it, but I assume so.
> If not, and it needs test suite fixes, those are ok too.

I did not.  It was a suggestion for actual GCC hackers, of which one I am
not.  I have never had GCC commit access, and I don't really know the
testing expectations and so forth.  I just thought since I thought of
a possible patch while trying to figure out what switch I was supposed
to be using, it was nicer to post that rather than just a bug report.


Thanks,
Roland
Tom Tromey - Sept. 10, 2010, 10:52 p.m.
>>>>> "Roland" == Roland McGrath <roland@redhat.com> writes:

>> This is ok.  You didn't mention whether you regtested it, but I assume so.
>> If not, and it needs test suite fixes, those are ok too.

Roland> I did not.  It was a suggestion for actual GCC hackers, of which
Roland> one I am not.  I have never had GCC commit access, and I don't
Roland> really know the testing expectations and so forth.  I just
Roland> thought since I thought of a possible patch while trying to
Roland> figure out what switch I was supposed to be using, it was nicer
Roland> to post that rather than just a bug report.

Ok.  I will try to get to it.

Tom
Roland McGrath - Sept. 11, 2010, 2:13 a.m.
> >>>>> "Roland" == Roland McGrath <roland@redhat.com> writes:
> 
> >> This is ok.  You didn't mention whether you regtested it, but I assume so.
> >> If not, and it needs test suite fixes, those are ok too.
> 
> Roland> I did not.  It was a suggestion for actual GCC hackers, of which
> Roland> one I am not.  I have never had GCC commit access, and I don't
> Roland> really know the testing expectations and so forth.  I just
> Roland> thought since I thought of a possible patch while trying to
> Roland> figure out what switch I was supposed to be using, it was nicer
> Roland> to post that rather than just a bug report.
> 
> Ok.  I will try to get to it.

Thanks.  FWIW, there is nothing depending on this.  So without
synthetic test cases, it might not be noticed again any time soon.


Thanks,
Roland

Patch

diff --git a/libcpp/macro.c b/libcpp/macro.c
index 31de415..0000000 100644  
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -562,7 +562,8 @@  _cpp_arguments_ok (cpp_reader *pfile, cp
 	{
 	  if (CPP_PEDANTIC (pfile) && ! macro->syshdr)
 	    cpp_error (pfile, CPP_DL_PEDWARN,
-		       "ISO C99 requires rest arguments to be used");
+		       "macro %s: ISO C99 requires rest arguments to be used",
+		       NODE_NAME (node));
 	  return true;
 	}