c++ - end problem
- Rajiv Bhagwat (20/20) Aug 23 2001 This is really a 'c' problem, but since there is no 'c' newsgroup, it is
- Walter (3/23) Aug 23 2001 You're right, it conflicts with a name in the runtime library, and the
- Rajiv Bhagwat (9/39) Aug 24 2001 What about main() not complaining about arbitrary symbol? Not a show
- Walter (2/44) Aug 24 2001
This is really a 'c' problem, but since there is no 'c' newsgroup, it is here. This code segment has 2 problems: 1. 'any_bullshit' does not cause a syntax error. (Both for 'c' and 'cpp'). 2. If this is saved as 'test.c', optlink gives an error about 'end'. If -mn is specified, optlink crashes. If the file is saved as 'test.cpp', it encounters no errors and even runs. ---------- #include <stdio.h> void end(void *data, const char *el) { } int main( any_bullshit ) { printf("Hello from Test1\r\n"); return 0; } ------------ Seems like 'end' is special for DMC 'c'. The code piece is minimal runnable segment from an Expat sample, which uses 'end' as the handler for tag ends in a 'c' program, so other C compilers don't seem to have 'end' as a reserved routine. In any case, Optlink should not crash.
Aug 23 2001
You're right, it conflicts with a name in the runtime library, and the conflict also causes optlink to crash. -Walter Rajiv Bhagwat wrote in message <9m30qt$2b7s$1 digitaldaemon.com>...This is really a 'c' problem, but since there is no 'c' newsgroup, it is here. This code segment has 2 problems: 1. 'any_bullshit' does not cause a syntax error. (Both for 'c' and 'cpp'). 2. If this is saved as 'test.c', optlink gives an error about 'end'. If -mn is specified, optlink crashes. If the file is saved as 'test.cpp', it encounters no errors and even runs. ---------- #include <stdio.h> void end(void *data, const char *el) { } int main( any_bullshit ) { printf("Hello from Test1\r\n"); return 0; } ------------ Seems like 'end' is special for DMC 'c'. The code piece is minimal runnable segment from an Expat sample, which uses 'end' as the handler for tag ends in a 'c' program, so other C compilers don't seem to have 'end' as a reserved routine. In any case, Optlink should not crash.
Aug 23 2001
What about main() not complaining about arbitrary symbol? Not a show stopper, but the compiler should catch that error as well. -- Rajiv Walter <walter digitalmars.com> wrote in message news:9m4k36$aaq$1 digitaldaemon.com...You're right, it conflicts with a name in the runtime library, and the conflict also causes optlink to crash. -Walter Rajiv Bhagwat wrote in message <9m30qt$2b7s$1 digitaldaemon.com>...'cpp').This is really a 'c' problem, but since there is no 'c' newsgroup, it is here. This code segment has 2 problems: 1. 'any_bullshit' does not cause a syntax error. (Both for 'c' andIf -mn2. If this is saved as 'test.c', optlink gives an error about 'end'.runnableis specified, optlink crashes. If the file is saved as 'test.cpp', it encounters no errors and even runs. ---------- #include <stdio.h> void end(void *data, const char *el) { } int main( any_bullshit ) { printf("Hello from Test1\r\n"); return 0; } ------------ Seems like 'end' is special for DMC 'c'. The code piece is minimalendssegment from an Expat sample, which uses 'end' as the handler for tagin a 'c' program, so other C compilers don't seem to have 'end' as a reserved routine. In any case, Optlink should not crash.
Aug 24 2001
That gets declared as an int. Isn't C lovely? <g> Rajiv Bhagwat wrote in message <9m5gev$1q5i$1 digitaldaemon.com>...What about main() not complaining about arbitrary symbol? Not a show stopper, but the compiler should catch that error as well. -- Rajiv Walter <walter digitalmars.com> wrote in message news:9m4k36$aaq$1 digitaldaemon.com...You're right, it conflicts with a name in the runtime library, and the conflict also causes optlink to crash. -Walter Rajiv Bhagwat wrote in message <9m30qt$2b7s$1 digitaldaemon.com>...'cpp').This is really a 'c' problem, but since there is no 'c' newsgroup, it is here. This code segment has 2 problems: 1. 'any_bullshit' does not cause a syntax error. (Both for 'c' andIf -mn2. If this is saved as 'test.c', optlink gives an error about 'end'.runnableis specified, optlink crashes. If the file is saved as 'test.cpp', it encounters no errors and even runs. ---------- #include <stdio.h> void end(void *data, const char *el) { } int main( any_bullshit ) { printf("Hello from Test1\r\n"); return 0; } ------------ Seems like 'end' is special for DMC 'c'. The code piece is minimalendssegment from an Expat sample, which uses 'end' as the handler for tagin a 'c' program, so other C compilers don't seem to have 'end' as a reserved routine. In any case, Optlink should not crash.
Aug 24 2001