Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

enable compiler warnings (GDC)

Moderators: larsivi kris

Posted: 05/08/08 14:10:04

I'm using Tango for a few days now and I'm pretty impressed of it. Porting my code from Phobos was a bunch of work, but I managed to get nearly everything working. Just one problem stays: I would like to compile my code with all warnings enabled so I can write really "clean" code. But when I add the options -Wall -Werror -Wfatal-errors I get errors inside Tango. "Implicit cast can cause loss of data" and stuff like that...

so the question: How can I tell the compiler, that my code should be treated very strictly, but tangos not?

Author Message

Posted: 05/09/08 18:42:30

Hi Krox,

it is very unfortunate that Tango isn't warning clean on non-x86 platforms, but especially 64 bit platforms will be very much work. I don't think it is possible to limit the application of the -w switch, so your best hope will be to help making Tango warning clean ;)

Thank you for liking Tango :)

Posted: 05/09/08 22:25:09 -- Modified: 05/10/08 09:05:06 by

Well, actually I MIGHT help really. I'm pretty experienced in programming (and did a stdlib for my own OS long time ago). But when I modify tango, I would have/like to have the very current version of it. So I would need some little description, how to integrate the tango repo into my system, and how to build the library. Currently I'm using some precompiled bundle without dsss on Linux.

edit: okay, I found the svn and followed the steps at wiki-page. Seems pretty straight forward. But when I build my actual project, I get an "symbol defined multiple times" error inside libgphobos.a.

Posted: 05/10/08 09:27:50

Hard to say without actually knowing which symbols you talk about, but there used to be a problem with gcc.builtins, in which case you can try to remove builtins.o from your libgphobos:

ar -d libgphobos.a

Posted: 05/10/08 14:39:09

Yeah, that solved the problem, thanks a lot, nice to have the cutting-edge stuff :)

So... if I had a patch so submit, whats the easiest way to do, and what do I have to be aware of? I'm talking just simple corrections like "size_t instead of uint", which solves alot of warnings

Posted: 05/10/08 17:08:00

Pipe the output of svn diff to a file and attach it to a ticket - some modules already have tickets but no patches, so you could take a look at the roadmap, milestone 0.99.7 for those.

If there are no difficult issues, see if it is possible to make whole modules warning free, will make it easier to keep track. Use

gdc/dmd -c modulename.d

to test a particular file, although some warnings potentially may only show up on usage.

Hope this explains it. Thanks :)