Oliviers-OSS / mscgen

Automatically exported from code.google.com/p/mscgen
GNU General Public License v2.0
0 stars 0 forks source link

Compiler Warnings #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Set the following two variables:
CFLAGS="-Wall -Wextra" 
CXXFLAGS="-Wall -Wextra" 
and then run make

What is the expected output? What do you see instead?
Fewer warnings (ignoring the ones from null_out.c)

What version of the product are you using? On what operating system?
I used mscgen-0.14 on a debian/lenny

Other info.
I have created a patch that fixes most of the issues. For most parts these
warnings were different signedness in comparisons (which I have removed by
typecasting or changing the signedness of some of the variables). Two
issues remain though:

 * I did not know how to deal with the missing return statement in
renderer/gd_out.c's getColorRef(). Someone with knowledge about how it is
expected to behave needs to deal with that.
 * "unistd.h" is not a standard header (namely I am pretty sure Windows
does not have it), so in renderer/main.c I put it in a cpp conditional. It
uses the same syntax as autoconf uses in its "config.h". If your Makefile
has some way of determining the availability of header-files, you can use
-DHAVE_UNISTD_H to get the file included. Alternatively, if there is
interest for it, I can setup an autoconf build system for this. 

This patch does not fix anything in null_out.c - The file name suggested
the "unused parameter" warnings were very expected. If anything, add a flag
in the Makefile to always suppress warnings from this file.

Again I expect that most of these (save for the missing return) were not
likely to cause issues, but I saw the request for getting a debian package
out of this (http://code.google.com/p/mscgen/issues/detail?id=6) and if
they are as uptight with the code as they are with their packages, you
might have heard it from a maintainer instead of me.

~Niels

Original issue reported on code.google.com by NThykier@gmail.com on 19 May 2009 at 9:38

Attachments:

GoogleCodeExporter commented 9 years ago
I've fixed the missing return in gd_out.c in trunk.

Original comment by Michael....@gmail.com on 23 May 2009 at 5:12

GoogleCodeExporter commented 9 years ago
-Wall -Wextra added and warnings removed.  
I've added an UNUSED macro to suppress the warnings coming from null_out.c

No problem with people or tools being 'uptight' with code - it's good to knock 
out
trivial things in this way.  The gd_out.c error was a real bug (that no-one 
else has
reported before!).

Thanks.

Original comment by Michael....@gmail.com on 23 May 2009 at 5:46

GoogleCodeExporter commented 9 years ago
I think I've got them all now in the 0.15 release.

Original comment by Michael....@gmail.com on 25 May 2009 at 5:19