On Tue, Oct 24, 2006 at 11:46:46AM -0400, Daniel Jacobowitz wrote:
: Have you looked at the assembly code for this function?  GCC 3
: and GCC 4 do not include the "if (0)" block in their output, even with
: optimization disabled.  GDB is setting the breakpoint at the closest
: possible location.
: 
: I do not consider this a bug.


Dan, thanks for replying so quickly.

The bug also happens in 'real' code.

This is only a very reduced showcase code for the bug,
the bug also occurs in some (pretty big) code of mine
where
    if (0)
is actually
    if (!some_function(....))
i.e. if the function failed, jump to the failure label.


I believe the   -O0 -g   does not let gcc optimize the
if (0) away; however, if it does, you'd have to place
some dummy function in the if.


Regards,

Claus

-- 
Claus Fischer <[EMAIL PROTECTED]>
http://www.clausfischer.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to