Menu

#3489 Optional file type override -x stopped working

open
nobody
None
other
5
2022-09-19
2022-09-18
Deqing Sun
No

When doing something like

/Users/sundeqing/Desktop/untitledfolder2/sdcc/sdcc/bin/sdcc -c -E -MC -mmcs51 -x c /Users/sundeqing/Desktop/untitledfolder2/build/sketch/sketch_sep18a.ino.cpp -o /Users/sundeqing/Desktop/untitledfolder2/build/preproc/ctags_target_for_gcc_minus_e.cpp

The v13706 will throw

sdcpp: error: /Users/sundeqing/Desktop/untitledfolder2/build/sketch/sketch_sep18a.ino.cpp: C++ compiler not installed on this system

But the v13407 worked.

This was how Benedikt Freisen explained this feature. https://github.com/tenbaht/sduino/issues/120

Discussion

  • Benedikt Freisen

    sdcpp received a major update very recently, namely from version 4.6.3 to version 12.1.0.
    Apparently, it now tries to invoke a nonexistent C++ compiler.

    Maybe -x c is not forwarded to sdcpp.

     
    • Deqing Sun

      Deqing Sun - 2022-09-18

      This seems to be the reason.

      sdcc/bin/sdcpp -E sketch_sep18a.ino.cpp -o test.c
      sdcpp: error: sketch_sep18a.ino.cpp: C++ compiler not installed on this system
      
      sdcc/bin/sdcpp -x c -E sketch_sep18a.ino.cpp -o test.c
      

      The second one seems to be OK.

       
  • Felix

    Felix - 2022-09-19

    From [r13710], we pass -xc to the preprocessor, effectively hardwiring "C" as the input language.

    Now, it is not required to set the -xc flag when compiling code from files with .cpp extension, but it won't hurt. I'm not sure if this needs changing in the future.

     

    Related

    Commit: [r13710]


Log in to post a comment.

MongoDB Logo MongoDB