lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] [bug #37552] IAR EWARM won't compile ppp-new due to key


From: Simon Goldschmidt
Subject: Re: [lwip-devel] [bug #37552] IAR EWARM won't compile ppp-new due to keyword clash
Date: Fri, 12 Oct 2012 11:46:39 +0200

Mason wrote:
> > The word "class" is reserved in IAR's EWARM compiler since it looks like
> c++.
> > This causes a failure to compile in the lcp code.
> 
> Can't you put the compiler in "C mode" ?

You can and it works, I just checked that (I'm using IAR EWARM, too, right 
now). However, that's no solution as one might *want* to compile lwIP in C++ 
mode to be able to define port-functions (like sem_*, mbox_* or 
leightweight_prot_* functions) to inline C++ functions if needed (like I do).

> > Arguably it is a bug in the compiler, but it is easy to work around with
> a
> > name change in the lcp.[ch] code. I fixed it by changing "class" to
> "class_".
> 
> IMO, "fixing" code because of broken (proprietary) tools is a
> very slippery slope.

I don't like adapting code to work around broken compilers, but I don't think 
this is actually a bug in the compiler: "class" is a reserved keyword in C++ 
and I want lwIP to be C++ compatible for good portability. The reason this is 
not a problem in the original pppd is probably that they don't need the code to 
be portable: it's always compiled into a single C executable. 


Simon



reply via email to

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