Click on image to see enlargment
In preparing a celebratory banner to honor his nation's birth the programmer noticed that a key character was missing from the expected output string. What went wrong?
bug428.cpp lint Output
--- Module: bug428.cpp During Specific Walk: File bug428.cpp line 12: ith_character(-1) bug428.cpp(18) : Warning 428: negative subscript (-1) in operator '[' [Reference: file bug428.cpp: lines 8, 12, 18]
Reference Manual Explanation
428 negative subscript (Integer) in operator 'String' -- A negative integer was added to an array or to a pointer to an allocated area (allocated by malloc, operator new, etc.) This message is not given for pointers whose origin is unknown since a negative subscript is, in general, legal. The addition could have occurred as part of a subscript operation or as part of a pointer arithmetic operation. The operator is denoted by String. The value of the integer is given by Integer.
If you have comments or questions about this bug, please post them to our Discussion Forum
Previous Bug - Bug #424 - June 2006