#1853 sdcc -E differs from sdcpp


Hi devs,
I see a difference between sdcc with only pre-processor and sdcpp.
I use some info in the pre defined macros, and to keep our multi-architecture build environment.

I give you the test suite.
With an empty file (dummy.c), we use this command to get the pre-processor parser outputs:
$ sdcc -E -Wp-dM dummy.c
This gives us the defined SDCC, the version & revission.
If we do the same with sdcpp, we miss SDCC, version & revision (i think it should have)
$ sdcpp -dM dummy.c


  • Maarten Brock

    Maarten Brock - 2011-09-26
    • milestone: --> non_bugs
    • assigned_to: nobody --> maartenbrock
    • status: open --> pending-rejected
  • Maarten Brock

    Maarten Brock - 2011-09-26

    But it is sdcc that enters those defines on the command line when it calls sdcpp. If you use --verbose you can see that. I don't see why this is a bug.

  • Rafael Campos Las Heras

    I think it`s inconsistent output. I see the same response in gcc & cpp
    $ gcc -E -dM dummy.c
    $ cpp -dM dummy.c

  • Rafael Campos Las Heras

    • status: pending-rejected --> open-rejected
  • Borut Ražem

    Borut Ražem - 2011-09-29
    • status: open-rejected --> closed-rejected
  • Borut Ražem

    Borut Ražem - 2011-09-29

    There is a big difference between preprocessor implementations in gcc and sdcc: in gcc the preprocessor is built-in: is a part of gcc itself, while in sdcc sdcpp it is a totally separate application. Sdcc calls sdcpp by passing sdcc specific macros on the command line:
    sdcc -V -E -Wp-dM dummy.c shows the following:
    + "sdcpp" -nostdinc -Wall -dM -obj-ext=.rel -DSDCC_MODEL_SMALL -DSDCC_FLOAT_REENT -DSDCC=304 -DSDCC_REVISION=6752 -DSDCC_mcs51 -D__mcs51 ...

    So sdcpp doesn't know anything about sdcc, unless it receives macro definitions from the command line, which happens when sdcpp is called from sdcc.



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks