Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute
Home

[Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#3427) Remove noreturn attribute
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Fri, 14 Feb 2003 12:00:07 -0800
Reply-to: rt@xxxxxxxxxxxxxx

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.

> The purpose of getting compiler warnings is to catch bugs.  Only a small 
> portion of compiler warnings are actually because of bugs, but it is 
> nonetheless an efficient way to find them.

> Warnings generated by the noreturn attribute are much better than
> the 'average' warning in terms of finding bad pieces of code.

I don't see what useful compiler warnings could be generated by
noreturn. The only warning I can think of is something like "warning:
statement in line xyz not reached" in

   die(...);
   x=y;

> I don't think it is a good trade-off to give up this checking in
> return for removing a few compiler warnings on a compiler that few
> (if any) of the developers use.

> Further, it is not necessary for everyone to see all the compiler 
> warnings.  If someone compiles on intel cc and writes a code that 
> generates a warning under gcc, any of the gcc-using developers can see 
> and correct this.  Unless intel cc can provide a better error-catching 
> warning set than the one we'd have to give up to use it, I don't think 
> the switch is worth it.

Hmmmm. I was going to give you the error messages of the sun compiler
to that this is unrelated to icc and every non-gcc compiler is
affected. It turns out that the compiler happily eats:

void f(void);

struct b;

int n;

struct b *g(int x)
{
  if (x == 0)
    return (struct b *) 4;
  else
    f();
  n=x;
}

I consider this an error.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "How about the new language C&? No, that's not 'c ampersand', 'c reference', 
  'reference to c' or 'c and'. It's pronounced 'campersand', to confuse the 
  hell out of people who are unfamiliar with it, and it will, of course, 
  have no pointers."
    -- Xazziri in comp.lang.c++ about C#




[Prev in Thread] Current Thread [Next in Thread]