https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
Andrew Pinski changed:
What|Removed |Added
Resolution|INVALID |DUPLICATE
--- Comment #12 from Andrew Pi
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
--- Comment #11 from Gary Funck 2011-07-07 19:01:19
UTC ---
Thanks for the additional info. I agree that it would be incorrect for the
compiler to default to "extern" if it chooses not to inline the function (I
hadn't thought that suggestion thr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
--- Comment #10 from Jonathan Wakely 2011-07-07
17:08:54 UTC ---
The point is your code is invalid and the compiler's behaviour at -O0 is
correct.
C99 6.9 "If an identifier declared with external linkage is used in an
expression (other than as p
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
--- Comment #9 from Gary Funck 2011-07-07 16:55:38
UTC ---
(In reply to comment #8)
> (In reply to comment #7)
> GF: If you're suggesting that the front-end would do this automatically when
> GF: compiling -O0 -std={gnu}99, I'd agree that this wo
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
--- Comment #8 from Jonathan Wakely 2011-07-07
16:49:18 UTC ---
(In reply to comment #7)
> (In reply to comment #6)
> > why not just add this to make the code valid by emitting an extern
> > definition?
> >
> > extern long trouble(long, long);
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
--- Comment #7 from Gary Funck 2011-07-07 16:38:33
UTC ---
(In reply to comment #6)
> why not just add this to make the code valid by emitting an extern definition?
>
> extern long trouble(long, long);
If you're suggesting that the front-end wo
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
--- Comment #6 from Jonathan Wakely 2011-07-06
19:37:00 UTC ---
why not just add this to make the code valid by emitting an extern definition?
extern long trouble(long, long);
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
--- Comment #5 from Gary Funck 2011-07-06 19:21:26
UTC ---
Would the following make sense as an enhancement, and still be standards
conforming?
RFE: If compiling in C99 mode at -O0 (optimization disabled), compile functions
declared as "inline"
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
--- Comment #4 from Gary Funck 2011-07-06 17:29:32
UTC ---
Thanks Andrew and Johannes for the follow-up. The difference in between
optimized and non-optimized compilations was surprising to me, but I now
understand that this is the result of the
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
Richard Guenther changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
Johannes Schaub changed:
What|Removed |Added
CC||schaub.johannes at
|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49653
--- Comment #1 from Andrew Pinski 2011-07-05
22:15:54 UTC ---
This is correct for C99. inline alone in C99 is the same GNU's C90's extern
inline.
12 matches
Mail list logo