#2077 False "may be used before initialization" warning

closed-fixed
Erik Petrich
5
2013-05-25
2012-09-04
No

AS of sdcc 3.2.1 #8084, ther eis a false "may be used before initialization" when before the use, there is a branch, so that in some cases the variable is initialized, and in other cases a function that does not return is called. Interestingly, the problem does not occour when the variable is initialized in all branches, and does not occour, when a function that does not return is called in all branches: It is only the mixed case that gets the warning.

Philipp

P.S.: Compiling the attached test.c gives:

test.c:13: warning 84: 'auto' variable 'p' may be used before initialization

Discussion

  • Small test case to reproduce the issue.

     
    Attachments
  • Erik Petrich
    Erik Petrich
    2012-09-14

    • labels: --> C-Front End
    • milestone: --> fixed
    • assigned_to: nobody --> epetrich
    • status: open --> closed-fixed
     
  • Erik Petrich
    Erik Petrich
    2012-09-14

    Fixed in revision #8103.

     
  • Added a regression test in revision #8105.

    Philipp