X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fstdnoreturn.m4;h=eea2c1e21dd1e6889f70b18640a2723445892acc;hb=cd56634a4a8179fd5a4419fbb3e27211b042ab1c;hp=6e10b120ae9518c49e708ae5f05148daadfc01e8;hpb=9a9dd2c085a29b7837437dd8fbf3ccc96d4e71df;p=gnulib.git diff --git a/m4/stdnoreturn.m4 b/m4/stdnoreturn.m4 index 6e10b120a..eea2c1e21 100644 --- a/m4/stdnoreturn.m4 +++ b/m4/stdnoreturn.m4 @@ -1,6 +1,6 @@ # Check for stdnoreturn.h that conforms to C11. -dnl Copyright 2012 Free Software Foundation, Inc. +dnl Copyright 2012-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -15,17 +15,16 @@ AC_DEFUN([gl_STDNORETURN_H], [AC_LANG_PROGRAM( [[#include #include - void noreturn foo1 (void) { exit (0); } - void _Noreturn foo2 (void) { exit (0); } - noreturn void foo3 (void) { exit (0); } - _Noreturn void foo4 (void) { exit (0); } - int main (int argc, char **argv) { + /* Do not check for 'noreturn' after the return type. + C11 allows it, but it's rarely done that way + and circa-2012 bleeding-edge GCC rejects it when given + -Werror=old-style-declaration. */ + noreturn void foo1 (void) { exit (0); } + _Noreturn void foo2 (void) { exit (0); } + int testit (int argc, char **argv) { if (argc & 1) return 0; - ((argv[0][0] - ? (argv[0][1] ? foo1 : foo2) - : (argv[0][1] ? foo3 : foo4)) - ()); + (argv[0][0] ? foo1 : foo2) (); } ]])], [gl_cv_header_working_stdnoreturn_h=yes],