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

             Bug #: 51644
           Summary: [4.7 Regression] va_list vs. warning: ‘noreturn’
                    function does return is not fixable
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jan.kratoch...@redhat.com


PASS: gcc (GCC) 4.6.3 20111220 (prerelease)
FAIL: gcc (GCC) 4.7.0 20111220 (experimental)

#include <stdarg.h>
extern __attribute__ ((__noreturn__)) void b (int s, va_list ap);
__attribute__ ((__noreturn__)) void a (int s, ...)
{
  va_list args;
  va_start (args, s);
  b (s, args);
  va_end (args);
}

-Wall -fexceptions

35.c:9:1: warning: ‘noreturn’ function does return [enabled by default]

It gets fixed by removing that "va_end" but I must not (suggested by Tom
Tromey):

ISO C99 7.15.1 
Each invocation of the va_start and va_copy macros shall be matched by a
corresponding invocation of the va_end macro in the same function.

Reply via email to