[Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
> On Fri, Feb 14, 2003 at 11:13:05AM -0800, Jason Short wrote:
>
>>Raimar Falke wrote:
>>
>>>Non-gcc compiler will complain about the missing return statements and
>>>so on.
>>
>>I'm strongly against this change.
>
>
> So did I convinced you?
Well, not really. I do see the value of getting compiler warnings from
other compilers, and that is made easier by avoiding spurious warnings.
I'm not actually sure that gcc will give an error in the above case.
Perhaps it will be intelligent, and will allow the 'return' statement as
long as you don't try to actually do anything.
Another alternative is to use macros to avoid the gcc warning.
Something like:
#ifdef __GCC__
# define noreturn(x)
#else
# define noreturn(x) return (x)
#endif
which makes clear to the reader that the line is never reached, takes
advantage of the noreturn attribute, and also avoids any compiler
warnings under non-gcc compilers.
jason
- [Freeciv-Dev] (PR#3427) Remove noreturn attribute, Jason Short, 2003/02/27
- Message not available
- [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute, Raimar Falke, 2003/02/27
- Message not available
- [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute, Jason Short, 2003/02/27
- Message not available
- [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute, Raimar Falke, 2003/02/27
- [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute, Mike Kaufman, 2003/02/27
- Message not available
- [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute, Reinier Post, 2003/02/27
- Message not available
- [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute, Raimar Falke, 2003/02/28
- Message not available
- [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute, Jason Short, 2003/02/28
|
|