On Wednesday 18 July 2007, Per Inge Mathisen wrote:
> On 7/18/07, Martin Koller <[EMAIL PROTECTED]> wrote:
> > is there any interest in allowing to compile wz with a C++ compiler
>
> If you look at the coding style document (in the wiki), you'll see we
> require that patches remain C++ compatible.

Interesting. I ask myself, what is the reasoning behind if you don't like to 
use C++ ?

>
> > and allowing future additions to use C++ ?
>
> Not unless absolutely necessary.

Nothing is absolutely necessary. But it's much easier and less error prone to 
use
NETMSG m;
 to have a ready initialized variable than always
NETMSG m;
NETmsgInit(&m);

> > I made a simple check by compiling wz with g++ to see what happens.
> > There are only about 250 errors, which are mainly invalid datatype
> > conversions (e.g. not casting the returnvalue from malloc() to a specific
> > pointer type or assigning an int to an enum type)
>
> Compile with -fpermissive to make (hopefully all of) them go away.

Nope. Does not work fully (most are gone, e.g. the malloc() things, but the 
assignment to an enum type is still an error)
permissive does not suppress the warnings either, it just makes some errors be 
only warnings (which is still ugly when you compile with a lot of them)

> > IMHO those things should be corrected even for plain C compilation, as
> > it's kind of ugly and might hide bugs.
>
> No, you should not cast the value returned from malloc in C...

"you should not" in the meaning of "in C it is not needed" or "this is against 
our rules" ?
It would not hurt to still use a cast.

-- 
Best regards/Schöne Grüße

Martin    ()  ascii ribbon campaign - against html mail 
          /\                        - against microsoft attachments

Computers and Internet gave you freedom.
TCPA would TAKE your FREEDOM!  http://www.againsttcpa.com

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to