| 1 |
dnl Date: Sun, 26 Feb 2012 11:31:50 -0800 |
| 2 |
dnl From: Paul Eggert <[email protected]> |
| 3 |
dnl To: [email protected] |
| 4 |
dnl CC: [email protected] |
| 5 |
dnl Subject: Re: avoid gcc 4.6.2 'may be used before set' warnings in dfa.c |
| 6 |
dnl |
| 7 |
dnl On 02/26/2012 01:18 AM, [email protected] wrote: |
| 8 |
dnl > It looks like I can just use the code as it is now in grep. I have asked |
| 9 |
dnl > for compile failures and haven't gotten any. |
| 10 |
dnl |
| 11 |
dnl Sure, but the gnulib support for this is better |
| 12 |
dnl than what's in the dfa code. It could be that |
| 13 |
dnl your correspondents aren't using the less-common hosts |
| 14 |
dnl or compiler warning options that gnulib is ported to. |
| 15 |
dnl |
| 16 |
dnl In the long run stdnoreturn.h or _Noreturn is the way to go, |
| 17 |
dnl since they're part of the C standard. |
| 18 |
dnl |
| 19 |
dnl If you'd rather not create a separate file, how about if |
| 20 |
dnl we change the dfa code to use _Noreturn instead of |
| 21 |
dnl <stdnoreturn.h> and noreturn, and you can put the |
| 22 |
dnl following into your configure.ac so that config.h |
| 23 |
dnl defines _Noreturn the same way gnulib does: |
| 24 |
|
| 25 |
AC_DEFUN([GAWK_AC_NORETURN],[ |
| 26 |
AH_VERBATIM([_Noreturn], |
| 27 |
[/* The _Noreturn keyword of C11. */ |
| 28 |
#ifndef _Noreturn |
| 29 |
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ |
| 30 |
|| 0x5110 <= __SUNPRO_C) |
| 31 |
# define _Noreturn __attribute__ ((__noreturn__)) |
| 32 |
# elif defined _MSC_VER && 1200 <= _MSC_VER |
| 33 |
# define _Noreturn __declspec (noreturn) |
| 34 |
# else |
| 35 |
# define _Noreturn |
| 36 |
# endif |
| 37 |
#endif |
| 38 |
])]) |