This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

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

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

--- Comment #5 from Denis Kolesnik <lirex.software at gmail dot com> 2012-08-09 23:19:16 UTC ---
The syntax of the programming language "C++" includes the syntax of the
programming language "C"
and also it should handle such common functions as "strcat". 

So if I define variables in a such way:

CHAR SQL1[150], SQL2[150], SQL_date_payment[10], SQL_date_begin[10],
SQL_date_end[10],  SQL_result[100];   

instead of:

CHAR SQL_date_payment[10],SQL_date_begin[10], SQL_date_end[10], SQL1[150],
SQL2[150], SQL_result[100];   

(where variables for dates which I form using "strcpy" and "strcat" functions
stay after SQL1)

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.


I never heard, that the "C" language is outdated. The "C++" is just another
standart which includes
the syntax of "C".

So I consider it is as an GCC error which should be fixed, also because all
standart libraries
come along with GCC.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]