[Top][All Lists]
[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: |
Mark Lakata |
Subject: |
Re: [lwip-devel] [bug #37552] IAR EWARM won't compile ppp-new due to keyword clash |
Date: |
Fri, 12 Oct 2012 09:54:27 -0700 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 |
The old lwip (1.4) code I used originally did not have this problem,
because 'PPP_MULTILINK' wasn't defined by default, and if it were, worse
things would happen because 'struct epdisc' was never declared or
defined. I'm not sure what ST did to make their STM32 demo code....
anyways, that is history.
extern "C" does not work (I tried it for fun). I'm compiling a cpp file
that includes ppp.h and pppapi.h and somewhere it includes lcp.h, and
'class' is not allowed as a symbolic name.
On 10/12/2012 2:07 AM, Mason wrote:
Mark Lakata 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" ?
I can't put the compiler in 'c' mode to compile 'c++'.
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.
Probably, but g++ does the same thing.
$ cat test1.cpp
extern "C" {
struct foo {
int class;
} bar;
}
main() {
}
$ make test1
g++ test1.cpp -o test1
test1.cpp:3: error: expected identifier before ';' token
<builtin>: recipe for target `test1' failed
make: *** [test1] Error 1
$ cat test1.cpp
extern "C" {
struct foo {
int class_;
} bar;
}
main() {
}
$ make test1
g++ test1.cpp -o test1
$
Re: [lwip-devel] [bug #37552] IAR EWARM won't compile ppp-new due to keyword clash, Mason, 2012/10/12