Menu

#3483 Preprocessor crash on #include when no include path supplied

closed-fixed
Felix
None
Preprocessor
5
2023-02-17
2022-09-12
No

On a Debian GNU/Linux testing system on amd64, the code from [bugs:#3470] crashes the preprocessor when compiled using sdcc from current svn:

philipp@notebook6:/tmp$ ~/sdcc-trunk/sdcc/bin/sdcc test2.c
cc1: files.cc:1059: cpp_dir* search_path_head(cpp_reader*, const char*, int, include_type): Assertion `dir' failed.
cpp: internal compiler error: Aborted signal terminated program cc1
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <http://sourceforge.net/tracker/?atid=100599&group_id=599&func=browse> for instructions.
at 1: warning 190: ISO C forbids an empty source file
subprocess error 1024

Also, the error message is not very helpful, as it asks to "submit a full bug report, with preprocessed source", which obviously won't work or make sense when the crash is in the preprocessor.

Related

Bugs: #3470
Wiki: SDCC 4.3.0 Release

Discussion

  • Philipp Klaus Krause

    Hmm, I now see this issue on any file that has an #include, even if it is otherwise empty:

    philipp@notebook6:/tmp$ cat test.c
    #include <stdint.h>
    

    Gives:

    philipp@notebook6:/tmp$ ~/sdcc-trunk/sdcc/bin/sdcc test.c
    cc1: files.cc:1059: cpp_dir* search_path_head(cpp_reader*, const char*, int, include_type): Assertion `dir' failed.
    cpp: internal compiler error: Aborted signal terminated program cc1
    Please submit a full bug report, with preprocessed source (by using -freport-bug).
    See <http://sourceforge.net/tracker/?atid=100599&group_id=599&func=browse> for instructions.
    at 1: warning 190: ISO C forbids an empty source file
    subprocess error 1024
    
     
  • Philipp Klaus Krause

    • summary: Preprocessor crash --> Preprocessor crash on #include when no include path supplied
     
  • Philipp Klaus Krause

    Manually supplying an include path, even just -I. is a workaround.

    P.S.: This only works if the supplied include path is a directory that actually exists.

     

    Last edit: Philipp Klaus Krause 2022-11-06
  • Felix

    Felix - 2023-02-17
    • status: open --> closed-fixed
    • assigned_to: Felix
     
  • Felix

    Felix - 2023-02-17

    fixed in [r13893 ].

     

    Related

    Commit: [r13893]


Log in to post a comment.