bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #43569] Fix for compile warnings with gcc 4.6.3


From: Ingo Schwarze
Subject: [bug #43569] Fix for compile warnings with gcc 4.6.3
Date: Tue, 11 Nov 2014 13:49:59 +0000
User-agent: Mozilla/5.0 (X11; OpenBSD i386; rv:33.0) Gecko/20100101 Firefox/33.0

Follow-up Comment #5, bug #43569 (project groff):

> However, the warning
> version.cpp:3:24: warning: `Version_string' initialized
> and declared `extern' [enabled by default]
> SHOULD be fixed, as it is a syntactical error.
> The line is generates in
> groff-1.22.3/src/libs/libgroff/Makefile.sub

You are essentially reverting the libgroff/Makefile.sub part of:

http://git.savannah.gnu.org/cgit/groff.git/commit/?id=b1b253a4e1fe8ae3c2071c88b5d1e19ef6eb8968

Maybe that's ok (I'm not sure).

> Question: what is the correct way to suppress a warning
> if a return value is really not needed?

That can't be answered in one word.  Not every compiler warning can be
suppressed in any reasoable way, some compilers are just excessively chatty. 
In some cases - only for functions like snprintf() where ignoring the return
value is usually a severe error - it may be appropriate to cast to (void) if a
thorough audit reveals that ignoring the return value is OK in the
(exceptional) case at hand, usually together with a comment explaining *why*
it is ok, for the next auditor.  For functions like close() where it is
usually no problem to ignore the return value, nothing should be done, not
even a cast; doing anything would merely be a distraction from the clarity of
the code.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43569>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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