www.digitalmars.com         C & C++   DMDScript  

c++ - Incompatibilities with DMC-headers and preprocessor?

reply ELCO PRO <info elco-pro.de> writes:
Hi,

I probably ran into several incompatibilities with the own DMC headers
and its preprocessor ... just take a look at the following:

--------------------------------------------------------------------------------
1. the following combination of src/options doesn't work

Sample:
#include <stdbool.h>

struct test {
        bool t_bool;
};

int main(int argc, char **argv)
{
        struct test x;
        x.t_bool = true;
        return (x.t_bool ? 1 : 0);
}


I compiled it with the following command:
sc test0001.c -cpp -mn -C -WA -S -3 -a8 -c -otest0001.obj

This is explainable and might be correct ... ?!?
The example above can be compiled when I remove #include <stdbool.h>

2. Preprocessor recognizes statements that aren't of our interest

Sample:
#if 0
#warning fubar
#endif

The "#warning" statement should be ignored ...

3. strict ANSI support broken?

Sample:
#include <stdlib.h>

int main(int argc, char**argv)
{
        return 0;
}

Compiled with:
sc test0002.c -A -cpp -mn -C -WA -S -3 -a8 -c -otest0002.obj
---------------------------------------------------------------------------------

Anyway, I
'm glad to see that the work on DMC (Symantec C++) continues and 
I like the new features and now I think about using this compiler in my
next
projects ...

Best regards,
Mark Junker
Oct 02 2001
parent "Walter" <walter digitalmars.com> writes:
Thanks. I logged the bugs. -Walter

ELCO PRO wrote in message <3BBA2767.DEF92C36 elco-pro.de>...
Hi,

I probably ran into several incompatibilities with the own DMC headers
and its preprocessor ... just take a look at the following:

---------------------------------------------------------------------------

1. the following combination of src/options doesn't work

Sample:
#include <stdbool.h>

struct test {
        bool t_bool;
};

int main(int argc, char **argv)
{
        struct test x;
        x.t_bool = true;
        return (x.t_bool ? 1 : 0);
}


I compiled it with the following command:
sc test0001.c -cpp -mn -C -WA -S -3 -a8 -c -otest0001.obj

This is explainable and might be correct ... ?!?
The example above can be compiled when I remove #include <stdbool.h>

2. Preprocessor recognizes statements that aren't of our interest

Sample:
#if 0
#warning fubar
#endif

The "#warning" statement should be ignored ...

3. strict ANSI support broken?

Sample:
#include <stdlib.h>

int main(int argc, char**argv)
{
        return 0;
}

Compiled with:
sc test0002.c -A -cpp -mn -C -WA -S -3 -a8 -c -otest0002.obj
---------------------------------------------------------------------------

Anyway, I
'm glad to see that the work on DMC (Symantec C++) continues and
I like the new features and now I think about using this compiler in my
next
projects ...

Best regards,
Mark Junker

Oct 02 2001