Bug 56599 - very confusing compiler diagnostics (for stupid bug on my part)
Summary: very confusing compiler diagnostics (for stupid bug on my part)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.5.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-11 18:01 UTC by Dave
Modified: 2013-03-11 23:44 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.8.0
Known to fail:
Last reconfirmed:


Attachments
preprocesser output for first program (2.10 KB, application/octet-stream)
2013-03-11 18:32 UTC, Dave
Details
preprocesser output for second program (2.06 KB, application/octet-stream)
2013-03-11 18:34 UTC, Dave
Details
first offending program (257 bytes, application/octet-stream)
2013-03-11 18:44 UTC, Dave
Details
second offending program (261 bytes, application/octet-stream)
2013-03-11 18:46 UTC, Dave
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave 2013-03-11 18:01:28 UTC

    
Comment 1 Andrew Pinski 2013-03-11 18:11:17 UTC
No info in bug.
Comment 2 Dave 2013-03-11 18:32:51 UTC
Created attachment 29641 [details]
preprocesser output for first program
Comment 3 Dave 2013-03-11 18:34:05 UTC
Created attachment 29642 [details]
preprocesser output for second program
Comment 4 Dave 2013-03-11 18:42:41 UTC
It looks as though it threw away everything I'd typed in when I added an attachment, & then submitted the empty report. <sigh>

gcc produced extremely confusing error messages, referencing perfectly valid line:columns, or (under debugging) referencing location in previously #included header file.  The bug would have been easily recognized if anything had indicated the correct location, but the messages weren't especially descriptive.

Instead of pasting them in, I'll try attaching the programs as well, this time.  See the .c versions & the error messages in the .txt files.  I guess I'm supposed to post this, then attach?  I'll try it that way.
Comment 5 Dave 2013-03-11 18:44:44 UTC
Created attachment 29643 [details]
first offending program

The compiler error output is as follows:
dlt8.c:7:22: error: expected ',' or ';' before numeric constant
Comment 6 Dave 2013-03-11 18:46:35 UTC
Created attachment 29644 [details]
second offending program

Compiler error output for this one puts the error in stdio.h:

In file included from dlt9.c:2:0:
f:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/stdio.h:641:21: error: expected ',' or ';' before numeric constant
Comment 7 Andrew Pinski 2013-03-11 18:49:38 UTC
Works on the trunk on x86_64-linux-gnu just fine:
dlt8.c:4:25: error: expected ‘,’ or ‘;’ before numeric constant
 #define  SAMPLELONGLONG 123456789012345
                         ^
dlt8.c:10:90: note: in expansion of macro ‘SAMPLELONGLONG’
    "Here we have some user info, wherein we stupidly try to include a numeric constant " SAMPLELONGLONG;
                                                                                          ^
apinski@apinskidesktop:~/Downloads$ ~/gcc-228/bin/gcc dlt9.c
dlt9.c:4:25: error: expected ‘,’ or ‘;’ before numeric constant
 #define  SAMPLELONGLONG 123456789012345
                         ^
dlt9.c:10:90: note: in expansion of macro ‘SAMPLELONGLONG’
    "Here we have some user info, wherein we stupidly try to include a numeric constant " SAMPLELONGLONG;
                                                                                          ^
Comment 8 dave 2013-03-11 18:51:12 UTC
On Mon, Mar 11, 2013 at 2:11 PM, pinskia at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56599
>
> --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-03-11 18:11:17 UTC ---
> No info in bug.
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.

I entered a complete description, then tried attaching the
preprocessor output.  It apparently threw away what I'd entered at
that point.  I've re-entered parts of it & attached more stuff.  I
guess I don't see how to attach without submitting?

-- Dave
Comment 9 dave 2013-03-11 18:54:10 UTC
As shown in other attachments, for me it generated references to other
lines (many lines away in the big program I tried to reduce this to),
& if I removed all earlier lines referencing a location in stdio.h !

-- Dave

On Mon, Mar 11, 2013 at 2:49 PM, pinskia at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56599
>
> --- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-03-11 18:49:38 UTC ---
> Works on the trunk on x86_64-linux-gnu just fine:
> dlt8.c:4:25: error: expected ‘,’ or ‘;’ before numeric constant
>  #define  SAMPLELONGLONG 123456789012345
>                          ^
> dlt8.c:10:90: note: in expansion of macro ‘SAMPLELONGLONG’
>     "Here we have some user info, wherein we stupidly try to include a numeric
> constant " SAMPLELONGLONG;
>
>           ^
> apinski@apinskidesktop:~/Downloads$ ~/gcc-228/bin/gcc dlt9.c
> dlt9.c:4:25: error: expected ‘,’ or ‘;’ before numeric constant
>  #define  SAMPLELONGLONG 123456789012345
>                          ^
> dlt9.c:10:90: note: in expansion of macro ‘SAMPLELONGLONG’
>     "Here we have some user info, wherein we stupidly try to include a numeric
> constant " SAMPLELONGLONG;
>
>           ^
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
Comment 10 dave 2013-03-11 18:58:00 UTC
I forgot to add when I reentered stuff.  This was from MinGW running
on Windows XP, but got same error messages on a Linux machine (sent it
to someone to check).  gcc --version shows this:
gcc (GCC) 4.5.2
I don't know how to tell what options the gcc was built with; I did
see that your "what we need listed that, but trying to figure it out I
came up with nothing.

-- Dave
Comment 11 Manuel López-Ibáñez 2013-03-11 23:15:16 UTC
Dave, this bug seems to be fixed in the about to be released GCC 4.8.0
Comment 12 Paolo Carlini 2013-03-11 23:44:13 UTC
Closing as fixed in mainline then.