gcc - C++ GCC4.4 warning: array subscript is above array bounds -


I have recently upgraded to GCC 4.4 (Minigud TDM Build) and now the compliance code produces these warnings. :

member function 'zero console :: print (const std :: string & amp;)':

WARNING: array is above subtitle array limit

code:

  zero console :: print (const std :: string and str) {std :: string newLine (str); If (newLine.size ()> MAX_LINE_LENGTH) {sf :: Uint32 stringSize = newLine.size (); {NewLine.insert (insertPos, "\ n") for (Sf :: Uint32 insertPos = MAX_LINE_LENGTH; insertPos & lt; stringSize; insertPOS + = MAX_LINE_LENGTH); }} String list token; Promotion: Partition (Token, Newline, Promotion :: is_any_of ("\ n")); (String List :: Iterator = Tokens.bugin (); it! = Tokens.and (); ++ this) {Adline (* this); }}  

Any ideas?


This is an adaptation which is doing this ...

It also appears that the line is due to this:

 < Code> boost :: split (token, newline, boost :: is_any_of ("\ n")); Ah, I found, there is a logic to promote it: is_any_of (), wrapping it into a string () the constructor's alert disappears, thank everyone for your help. For :)  
  Boost: split (token, newline, boost :: is_any_of (string ("\ n")));  

get the same error as a workaround

  is_any_of ("")  

with

  is_from_range ('', '')  

Which can be a little more efficient.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -