Jörg Sommer wrote: > Hello Neil, >> 2. -Wextra is *not supported* by gnucash and errors are to be expected. >> Don't use it. > > -Wextra does not generate any errors. It warns about common cases where > errors can araise.
That doesn't change the fact that upstream does not support it. :-) -Wextra DOES generate errors under -Werror because the warnings from -Wextra are promoted. Some of these "errors" are spurious, others require *large* amounts of changes to the codebase to prevent. I, for one, don't fancy the idea of recommending to upstream that hundreds of __attribute__ ((unused)) markers are added to the upstream code. ;-) >> You only have a problem because of extra compiler flags > > I don't have a problem. I point out some sources of problems before they > arise. But -Wextra is just that: extra. It is *not* a reliable indicator of problems, it just raises possibles and whereas some are worth changing, many are simply spurious (like unused above). A common case for unused is when a library defines a prototype for a callback but the specific instance doesn't use one or more of the prototype variables. We can't change the prototype, so the above unused kludge would be needed for -Wextra. Lines and lines of extra code making the codebase even less readable. Hmm, don't think upstream would like that. Stop using -Wextra and everything is fine. It's your choice but you haven't convinced me, yet, that it's worth getting flamed by upstream for suggesting it! -Wextra is *not* a Debian concern. It can only be implemented upstream because of the immense number of changes required. > For example, look at gnc-date.c:234. The function name timespec_abs() > suggests the value should be made a positive value, if it's negative. But > the comparison "retval.tv_sec < 0" is always false, due to tv_sec is > unsigned according gnc-date.h: Maybe, but is it worth the rest of the problems? I can only recommend that you isolate the *real* errors from the spurious warnings promoted to errors and create some patches. I can't see upstream implementing -Wextra for everyone. I'd also recommend broaching this directly with gnucash upstream over IRC or the gnucash-devel mailing list. PS gnc-date only now exists in gncqof, libqof1 has overhauled all date and time handling. I'm experimenting with -Wextra for libqof1. I'm not doubting it raises a few useful points, but applications like gnucash are not going to like it. -Wextra is fine, IMHO, for small utilities and small libraries, like libqof1. Having reviewed it in that situation, I would not be willing to recommend adopting it for a large app like gnucash. YMMV. -- Neil Williams ============= http://www.data-freedom.org/ http://www.nosoftwarepatents.com/ http://www.linux.codehelp.co.uk/
signature.asc
Description: OpenPGP digital signature