Menu ▾ ▴

#2147 Incorrect error message

closed-fixed
None
PIC14
5
2026-10-20
2013-03-29
No

Incorrect error message

$ sdcc --Werror -pp16f877a --opt-code-size -Ilibmain -DF_CPU=4000000 -mpic14 --use-non-free bug1.c
bug1.c:5: error 9: FATAL Compiler Internal Error in file '/home/sdcc-builder/build/sdcc-build/orig/sdcc/src/pic14/glue.c' line number '760' : !list || (list->type == INIT_NODE)
Contact Author with source code
$ sdcc -v
SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.0 #8008 (Jul 6 2012) (Linux)

1 Attachments

Discussion

  • BsAtHome

    BsAtHome - 2013-03-29

    The compiler should not have generated an internal error, but your code does not compile either way.

    You are trying to assign an array to a scalar, which will not work. My guess is that you were trying to write the following:
    uint8_t arr[] = { 6, 9, 8, 7, 6, };
    but forgot to add the [].

     
  • Kharitonov Dmitry

    Absolutely. I believe that the compiler must report a syntax error.

     
  • Christopher Bazley

    • assigned_to: Christopher Bazley
     
  • Christopher Bazley

    Original PIC14 invalid scalar initialiser now reports source errors rather than the backend glue assertion; recovery also produces error 47.
    https://godbolt.org/z/azfjsfW8b

     
  • Christopher Bazley

    • status: open --> closed-fixed
     
  • Christopher Bazley

    Added regression test in [r17047]

     

    Related

    Commit: [r17047]


Log in to post a comment.