public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/68075] New: Printf is changing the order of values
@ 2015-10-24  6:38 girish.elchuri at smuuthsolutions dot com
  2015-10-24  6:43 ` [Bug c/68075] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: girish.elchuri at smuuthsolutions dot com @ 2015-10-24  6:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68075

            Bug ID: 68075
           Summary: Printf is changing the order of values
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: girish.elchuri at smuuthsolutions dot com
  Target Milestone: ---

Created attachment 36571
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36571&action=edit
Code that is producing the wrong output.

Look at the following code segment attached herewith. This is giving the
output:

>><<, NULL
>><<, NULL
>><<, NULL
>>ghi<<, 'ghi'
>>def<<, 'def'
>>abc<<, 'abc'
'abc', 'abc', 'abc', 'abc', 'abc', 'abc'


While th expected output is:
>>abc<<, 'abc'
>>def<<, 'def
>>ghi<<, 'ghi'
>><<, NULL
>><<, NULL
>><<, NULL
'abc', 'def', 'ghi', NULL, NULL, NULL

This is a real bug, please fix it.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/68075] Printf is changing the order of values
  2015-10-24  6:38 [Bug c/68075] New: Printf is changing the order of values girish.elchuri at smuuthsolutions dot com
@ 2015-10-24  6:43 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-10-24  6:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68075

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The order of the get_db_insert_string function calls in
        printf ("%s, %s, %s, %s, %s, %s\n",
                        get_db_insert_string (db_val, &val[0][0]),
                        get_db_insert_string (db_val, &val[1][0]),
                        get_db_insert_string (db_val, &val[2][0]),
                        get_db_insert_string (db_val, &val[3][0]),
                        get_db_insert_string (db_val, &val[4][0]),
                        get_db_insert_string (db_val, &val[5][0]));

is not specified in C.  So both answers are correct and your expectations for
the order of the function calls is incorrect.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-24  6:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-24  6:38 [Bug c/68075] New: Printf is changing the order of values girish.elchuri at smuuthsolutions dot com
2015-10-24  6:43 ` [Bug c/68075] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).