#159 Fix for 3007799

closed-accepted
None
5
2012-06-02
2010-11-10
RvS
No

This patch fixes bug #3007799: Different warning for string initializer fitting without \0.
The C99 standard allows initializers to fill char arrays without the \0 terminator. This now generates an warning "excess elements in string initializer after <text>" .
Implemented is a different warning for this case: "string <name> cannot be terminated properly". With --less-pedantic the warning is suppressed.
The patch also contains the text for the changelog (without committer info)

Discussion

  • RvS

    RvS - 2010-11-10
     
  • Philipp Klaus Krause

    • assigned_to: nobody --> spth
    • status: open --> open-accepted
     
  • Philipp Klaus Krause

    I'll aplly a modified version of this in revision #7851 since

    1) Error message handling has changed a bit since this patch was made.
    2) The patch didn't handle the case of a string of size m > n used to initialize an array of size n but with a \0 in position n correctly.

    Philipp

     
  • Philipp Klaus Krause

    • status: open-accepted --> closed-accepted
     

Log in to post a comment.