This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/10031: 3.3/mainline c++ regression


>Number:         10031
>Category:       c++
>Synopsis:       3.3/mainline c++ regression
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 11 21:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Franz dot Sirl-kernel at lauterbach dot com
>Release:        gcc-3.3, gcc-3.4
>Organization:
>Environment:

>Description:
Since the bugfix for c++/9367 you'll see the following message if you compile the attached testcase with "g++ -c test-vprintf.cpp -O2 -ansi -pedantic-errors":

test-vprintf.cpp: In function `int vprintf(const char*, __va_list_tag*)':
test-vprintf.cpp:19: error: declaration of `int vprintf(const char*,
   __va_list_tag*) throw ()' throws different exceptions
test-vprintf.cpp:16: error: than previous declaration `int vprintf(const
char*,
   __va_list_tag*)'

Reportedly it happens on alpha-linux, powerpc-linux and x86_64-linux, but not on i686-linux.

>How-To-Repeat:
typedef __builtin_va_list __gnuc_va_list;

extern "C"
{

struct FILE
{
  int _flags;
};

extern struct FILE *stdout;

extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
                     __gnuc_va_list __arg) throw ();

extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg) throw ();

inline int vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) throw ()
{
  return vfprintf (stdout, __fmt, __arg);
}

}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="test-vprintf.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test-vprintf.cpp"

dHlwZWRlZiBfX2J1aWx0aW5fdmFfbGlzdCBfX2dudWNfdmFfbGlzdDsKCmV4dGVybiAiQyIgCnsK
ICAKc3RydWN0IEZJTEUgCnsKICBpbnQgX2ZsYWdzOwp9OwoKZXh0ZXJuIHN0cnVjdCBGSUxFICpz
dGRvdXQ7CgpleHRlcm4gaW50IHZmcHJpbnRmIChGSUxFICpfX3Jlc3RyaWN0IF9fcywgX19jb25z
dCBjaGFyICpfX3Jlc3RyaWN0IF9fZm9ybWF0LAoJCSAgICAgX19nbnVjX3ZhX2xpc3QgX19hcmcp
IHRocm93ICgpOwoKZXh0ZXJuIGludCB2cHJpbnRmIChfX2NvbnN0IGNoYXIgKl9fcmVzdHJpY3Qg
X19mb3JtYXQsIF9fZ251Y192YV9saXN0IF9fYXJnKSB0aHJvdyAoKTsKCmlubGluZSBpbnQgdnBy
aW50ZiAoX19jb25zdCBjaGFyICpfX3Jlc3RyaWN0IF9fZm10LCBfX2dudWNfdmFfbGlzdCBfX2Fy
ZykgdGhyb3cgKCkKewogIHJldHVybiB2ZnByaW50ZiAoc3Rkb3V0LCBfX2ZtdCwgX19hcmcpOwp9
Cgp9Cg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]