This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54180] a bug using strcat function - it depends on variable declare order, but it should not.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Aug 2012 14:51:15 +0000
- Subject: [Bug c++/54180] a bug using strcat function - it depends on variable declare order, but it should not.
- Auto-submitted: auto-generated
- References: <bug-54180-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54180
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-08-10 14:51:15 UTC ---
Your bug report is useless, you have not provided the information requested at
http://gcc.gnu.org/bugs/ so it cannot be compiled or verified, and your
description of the problem is hard to follow.
The problem is that your array is too small for the data you write to the
array. This has nothing to do with the order of declarations.
You declare SQL1[150] then you call
strcat(SQL1,"select id,' ', to_char(dt_date,'DD.MM.YYYY'),' ',int_from,'
','>',' ',int_to,' ',cur_amount,' ',(select str_comment from
tbl_dic_payment_types where tbl_dic_payment_types.id=tbl_bills.int_type) as
type,' ', (select case when int_type=1 then 'business' else 'personal' end from
tbl_bills_entity_type where tbl_bills_entity_type.int_bill=tbl_bills.id) as
test2 from tbl_bills ");
That's more than 150 characters. Your program has a bug, not GCC.