public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2663: enumerations passed through ellipses considered wrong type
@ 2001-04-26 21:36 psilord
  0 siblings, 0 replies; only message in thread
From: psilord @ 2001-04-26 21:36 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2663
>Category:       c++
>Synopsis:       enumerations passed through ellipses considered wrong type
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 26 21:36:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Peter K. Keller
>Release:        gcc version 3.0 20010426 (prerelease)
>Organization:
>Environment:
CodeSourcery's Online Test Compilation Page
>Description:
I'd like to report a bug in "gcc version 3.0 20010426 (prerelease)" that
was available at the "CodeSourcery's Online Test Compilation" page.
Basically the problem is that g++ does something strange with an enum that
ends up being used in a function that uses the '...' variable arguments
capability of C. For some reason, the compiler thinks the enum isn't an
int-sized quantity and tries to perform some promotion on it. This causes an
error(detailed in part 4 below). I looked around in GNATS, but didn't see
anything related to this bug.

You can just go to:
CodeSourcery's Online Test Compilation Page
and enter the "how to repeat" code to see it break.

Thank you.

-pete

Thank you.
>How-To-Repeat:
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#include<stdarg.h>

enum foobar_t { ___foobar_t_dummy_value___ = INT_MAX };

int func(int foo, ...)
{
    foobar_t f;
    va_list ap;

    va_start( ap, foo );

    f = va_arg(ap, foobar_t);

    va_end(ap);

    return 0;
}

int main(void)
{
    foobar_t foo;

    func(1, foo);

    return(0);
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-26 21:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-26 21:36 c++/2663: enumerations passed through ellipses considered wrong type psilord

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).