public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44586]  New: gcc does not warn about casting non-variadic types to variadic types
@ 2010-06-18 19:48 raj dot khem at gmail dot com
  2010-06-20 21:41 ` [Bug c/44586] " manu at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: raj dot khem at gmail dot com @ 2010-06-18 19:48 UTC (permalink / raw)
  To: gcc-bugs

the folowing testcase does a casting which results in undefined behaviour but
gcc does not warn about it.

ypedef int (*bar_t)(int x, int y, ...);

int foo(int x, int y) {
        return x+y;
}

void f(int x, int y) {
       bar_t bar;

       /* Cast foo to variadic type... undefined behaviour */
       bar = (bar_t) foo;
       (*bar)(x,y);
}


-- 
           Summary: gcc does not warn about casting non-variadic types to
                    variadic types
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raj dot khem at gmail dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


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

end of thread, other threads:[~2010-06-20 22:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-18 19:48 [Bug c/44586] New: gcc does not warn about casting non-variadic types to variadic types raj dot khem at gmail dot com
2010-06-20 21:41 ` [Bug c/44586] " manu at gcc dot gnu dot org
2010-06-20 22:17 ` joseph at codesourcery dot com
2010-06-20 22:25 ` manu 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).