public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/40880]  New: stdarg.h does not define va_copy when building for C89+POSIX
@ 2009-07-27 19:46 bmerry at gmail dot com
  2009-07-27 19:47 ` [Bug c/40880] " bmerry at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bmerry at gmail dot com @ 2009-07-27 19:46 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2192 bytes --]

POSIX 2001 specifies that va_copy
(http://www.opengroup.org/onlinepubs/009695399/functions/va_copy.html) is
defined by stdarg.h. However, when compiling with -std=c89
-D_POSIX_C_SOURCE=200112L this does not happen. I've encountered this in 4.3.2,
but a quick peek in svn makes it look this this is current.

I'll attach the source and preprocessed output.

Command line:
gcc -std=c89 -D_POSIX_C_SOURCE=200112L -Wall -c no_va_copy.c -save-temps
no_va_copy.c: In function ‘copy_va_list’:
no_va_copy.c:8: warning: implicit declaration of function ‘va_copy’

gcc -v:
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.3.2-r3/work/gcc-4.3.2/configure --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.2
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.2/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--disable-fixed-point --enable-nls --without-included-gettext
--with-system-zlib --disable-checking --disable-werror --enable-secureplt
--enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp
--disable-libgcj --enable-languages=c,c++,treelang,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.2-r3 p1.6,
pie-10.1.5'
Thread model: posix
gcc version 4.3.2 (Gentoo 4.3.2-r3 p1.6, pie-10.1.5)


-- 
           Summary: stdarg.h does not define va_copy when building for
                    C89+POSIX
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bmerry at gmail dot com
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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


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

* [Bug c/40880] stdarg.h does not define va_copy when building for C89+POSIX
  2009-07-27 19:46 [Bug c/40880] New: stdarg.h does not define va_copy when building for C89+POSIX bmerry at gmail dot com
@ 2009-07-27 19:47 ` bmerry at gmail dot com
  2009-07-27 19:47 ` bmerry at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bmerry at gmail dot com @ 2009-07-27 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bmerry at gmail dot com  2009-07-27 19:47 -------
Created an attachment (id=18259)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18259&action=view)
Preprocessed file


-- 


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


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

* [Bug c/40880] stdarg.h does not define va_copy when building for C89+POSIX
  2009-07-27 19:46 [Bug c/40880] New: stdarg.h does not define va_copy when building for C89+POSIX bmerry at gmail dot com
  2009-07-27 19:47 ` [Bug c/40880] " bmerry at gmail dot com
@ 2009-07-27 19:47 ` bmerry at gmail dot com
  2009-07-27 19:48 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bmerry at gmail dot com @ 2009-07-27 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bmerry at gmail dot com  2009-07-27 19:46 -------
Created an attachment (id=18258)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18258&action=view)
Source file illustrating the problem


-- 


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


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

* [Bug c/40880] stdarg.h does not define va_copy when building for C89+POSIX
  2009-07-27 19:46 [Bug c/40880] New: stdarg.h does not define va_copy when building for C89+POSIX bmerry at gmail dot com
  2009-07-27 19:47 ` [Bug c/40880] " bmerry at gmail dot com
  2009-07-27 19:47 ` bmerry at gmail dot com
@ 2009-07-27 19:48 ` pinskia at gcc dot gnu dot org
  2009-07-27 21:02 ` joseph at codesourcery dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-07-27 19:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2009-07-27 19:48 -------
*** Bug 40879 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug c/40880] stdarg.h does not define va_copy when building for C89+POSIX
  2009-07-27 19:46 [Bug c/40880] New: stdarg.h does not define va_copy when building for C89+POSIX bmerry at gmail dot com
                   ` (2 preceding siblings ...)
  2009-07-27 19:48 ` pinskia at gcc dot gnu dot org
@ 2009-07-27 21:02 ` joseph at codesourcery dot com
  2009-07-28  7:28 ` bmerry at gmail dot com
  2009-11-22 19:58 ` jsm28 at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: joseph at codesourcery dot com @ 2009-07-27 21:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from joseph at codesourcery dot com  2009-07-27 21:02 -------
Subject: Re:   New: stdarg.h does not define va_copy when building
 for C89+POSIX

On Mon, 27 Jul 2009, bmerry at gmail dot com wrote:

> POSIX 2001 specifies that va_copy
> (http://www.opengroup.org/onlinepubs/009695399/functions/va_copy.html) is
> defined by stdarg.h. However, when compiling with -std=c89
> -D_POSIX_C_SOURCE=200112L this does not happen. I've encountered this in 4.3.2,
> but a quick peek in svn makes it look this this is current.

POSIX 2001 is based on C99 and does not have any C89 language bindings, so 
it is not meaningful to say it imposes any requirements when not building 
in C99 mode.


-- 


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


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

* [Bug c/40880] stdarg.h does not define va_copy when building for C89+POSIX
  2009-07-27 19:46 [Bug c/40880] New: stdarg.h does not define va_copy when building for C89+POSIX bmerry at gmail dot com
                   ` (3 preceding siblings ...)
  2009-07-27 21:02 ` joseph at codesourcery dot com
@ 2009-07-28  7:28 ` bmerry at gmail dot com
  2009-11-22 19:58 ` jsm28 at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: bmerry at gmail dot com @ 2009-07-28  7:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from bmerry at gmail dot com  2009-07-28 07:28 -------
Thanks, I wasn't aware of that. It's slightly annoying that the behaviour is
different from glibc (I use -std=c89 so that the compiler keeps me honest,
since I'm working on code that has to compile on compilers that still haven't
gotten around to C99), but I can live with using __va_copy.


-- 


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


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

* [Bug c/40880] stdarg.h does not define va_copy when building for C89+POSIX
  2009-07-27 19:46 [Bug c/40880] New: stdarg.h does not define va_copy when building for C89+POSIX bmerry at gmail dot com
                   ` (4 preceding siblings ...)
  2009-07-28  7:28 ` bmerry at gmail dot com
@ 2009-11-22 19:58 ` jsm28 at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-11-22 19:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jsm28 at gcc dot gnu dot org  2009-11-22 19:58 -------
As discussed, not a bug.


-- 

jsm28 at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2009-11-22 19:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-27 19:46 [Bug c/40880] New: stdarg.h does not define va_copy when building for C89+POSIX bmerry at gmail dot com
2009-07-27 19:47 ` [Bug c/40880] " bmerry at gmail dot com
2009-07-27 19:47 ` bmerry at gmail dot com
2009-07-27 19:48 ` pinskia at gcc dot gnu dot org
2009-07-27 21:02 ` joseph at codesourcery dot com
2009-07-28  7:28 ` bmerry at gmail dot com
2009-11-22 19:58 ` jsm28 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).