#2077 False "may be used before initialization" warning


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.


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

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


  • Philipp Klaus Krause

    Small test case to reproduce the issue.

  • 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.

  • Philipp Klaus Krause

    Added a regression test in revision #8105.



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks