Menu

#228 Enumeration Error generates Seg Fault

closed-fixed
5
2013-05-25
2001-11-16
No

Hi,
When I compile the following line, I get a compiler error and a core dump. I guess it's up to the
compiler whether it will recognize 'A+4' as a constant expression (many compilers do). Either way,
we obviously don't want a segmentation fault here.

Geoffrey

enum{ A, B = A+4 };

test4.c(1):error *** Undefined identifier 'A'
test4.c(1):error *** Constant Expected Found Variable
0 [main] sdcc 1416 open_stackdumpfile: Dumping stack trace to sdcc.exe.stackdump
Segmentation fault (core dumped)

Discussion

  • Geoffrey Yerem

    Geoffrey Yerem - 2001-11-28
    • labels: 101551 --> C-Front End
    • status: open --> open-remind
     
  • Johan Knol

    Johan Knol - 2001-12-09

    Logged In: YES
    user_id=63512

    fixed in SDCC.y:1.52

     
  • Johan Knol

    Johan Knol - 2001-12-09
    • milestone: --> fixed
    • assigned_to: nobody --> johanknol
    • status: open-remind --> closed-fixed
     

Log in to post a comment.