public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/17877] New: __extension__ should apply to long long constants
@ 2004-10-07  8:45 algrant at acm dot org
  2004-10-07  9:33 ` [Bug c/17877] " schwab at suse dot de
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: algrant at acm dot org @ 2004-10-07  8:45 UTC (permalink / raw)
  To: gcc-bugs

__extension__ applies to use of the "long long" type but not
to long long constants.  So in --ansi --pedantic
  __extension__ long long n = __extension__ 3ll;
warns about the constant.

The intention behind the use of __extension__ in <stdint.h> is
clearly to provide 64-bit types in such a way that diagnostics are
not provoked by defining them in terms of 'long long'.  However,
use of INT64_C does provoke a diagnostic, which is unreasonable
(the user is not supposed to care how INT64_C is implemented).
This could be avoided if __extension__ applied to ll constants.

-- 
           Summary: __extension__ should apply to long long constants
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: algrant at acm dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17877


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/17877] __extension__ should apply to long long constants
  2004-10-07  8:45 [Bug c/17877] New: __extension__ should apply to long long constants algrant at acm dot org
@ 2004-10-07  9:33 ` schwab at suse dot de
  2004-10-07  9:48 ` algrant at acm dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: schwab at suse dot de @ 2004-10-07  9:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2004-10-07 09:33 -------
But C89 doesn't have <stdint.h> and INT64_C. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17877


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/17877] __extension__ should apply to long long constants
  2004-10-07  8:45 [Bug c/17877] New: __extension__ should apply to long long constants algrant at acm dot org
  2004-10-07  9:33 ` [Bug c/17877] " schwab at suse dot de
@ 2004-10-07  9:48 ` algrant at acm dot org
  2004-10-07 10:38 ` jsm at polyomino dot org dot uk
  2004-10-07 12:16 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: algrant at acm dot org @ 2004-10-07  9:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From algrant at acm dot org  2004-10-07 09:48 -------
Right, use of it in C89 is an extension.  That's the whole point,
and is why __extension__ is used in it.  But it only works for the
types, not the constants.

Someone clearly thinks "long long" should be available in C89
--ansi --pedantic, via __extension.  So the long long constant
syntax should also be available via __extension, to be consistent.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17877


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/17877] __extension__ should apply to long long constants
  2004-10-07  8:45 [Bug c/17877] New: __extension__ should apply to long long constants algrant at acm dot org
  2004-10-07  9:33 ` [Bug c/17877] " schwab at suse dot de
  2004-10-07  9:48 ` algrant at acm dot org
@ 2004-10-07 10:38 ` jsm at polyomino dot org dot uk
  2004-10-07 12:16 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jsm at polyomino dot org dot uk @ 2004-10-07 10:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jsm at polyomino dot org dot uk  2004-10-07 10:38 -------
Subject: Re:  New: __extension__ should apply to long long
 constants

On Thu, 7 Oct 2004, algrant at acm dot org wrote:

> __extension__ applies to use of the "long long" type but not
> to long long constants.  So in --ansi --pedantic
>   __extension__ long long n = __extension__ 3ll;
> warns about the constant.

Much the same applies to the macro I in <complex.h>, and an alternative 
possible solution would be not to warn if such constants arise from the 
expansion of macros in system headers.  In any case, this is already 
reported as bug 7263.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17877


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/17877] __extension__ should apply to long long constants
  2004-10-07  8:45 [Bug c/17877] New: __extension__ should apply to long long constants algrant at acm dot org
                   ` (2 preceding siblings ...)
  2004-10-07 10:38 ` jsm at polyomino dot org dot uk
@ 2004-10-07 12:16 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-07 12:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-07 12:16 -------


*** This bug has been marked as a duplicate of 7263 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17877


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-07 12:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-07  8:45 [Bug c/17877] New: __extension__ should apply to long long constants algrant at acm dot org
2004-10-07  9:33 ` [Bug c/17877] " schwab at suse dot de
2004-10-07  9:48 ` algrant at acm dot org
2004-10-07 10:38 ` jsm at polyomino dot org dot uk
2004-10-07 12:16 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).