[Bug c++/54180] a bug using strcat function - it depends on variable declare order, but it should not.

lirex.software at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Aug 18 21:29:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54180

Denis Kolesnik <lirex.software at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #17 from Denis Kolesnik <lirex.software at gmail dot com> 2012-08-18 21:28:56 UTC ---
(In reply to comment #11)
> Also, you declare SQL_date_begin[10] then fill it with 11 characters
> (YYYY-MM-DD plus the numm terminator) and do the same with SQL_date_end
> 
> This is horrible, horrible code and should be deleted immediately.
> 
> (In reply to comment #5)
> > it should work without problems, because of programming language syntax which
> > is a standart.
> > But it works so, that SQL1 partially overwrites value of SQL_date_begin and
> > values are
> > not such as expected.
> 
> Please check the standard before arguing about it. The C standard states that
> for the functions in <string.h> "If an array is accessed beyond the end of an
> object, the behavior is undefined."  
> 
> To understand undefined behaviour see:
> http://en.wikipedia.org/wiki/Undefined_behavior
> 
> 
> > I never heard, that the "C" language is outdated. The "C++" is just another
> > standart which includes
> > the syntax of "C".
> 
> Noone said it's outdated, what on earth are you talking about?
> 
> > So I consider it is as an GCC error which should be fixed, also because all
> > standart libraries
> > come along with GCC.
> 
> No, the strcat and strcpy functions come from the C library provided by your
> OS, they do not come from GCC. If you still believe there is a bug then maybe
> you should report it to Microsoft instead.

thank you for understandable answer!



More information about the Gcc-bugs mailing list