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]

[Bug c/51644] New: [4.7 Regression] va_list vs. warning: ânoreturnâ function does return is not fixable


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: unassigned@gcc.gnu.org
        ReportedBy: jan.kratochvil@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.


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