Opened 16 years ago

Closed 16 years ago

Last modified 7 months ago

#8227 closed patch

Fix for undefined (?) behaviour in fopenNoCase()

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game: The Dig

Description

There was some discussion on IRC about problems when
compiling ScummVM with -O2. For instance, there was no
opening cutscene in The Dig.

I can never remember which expressions are undefined
and which aren't, but this patch fixes the problem for me.

Ticket imported from: #739911. Ticket imported from: patches/332.

Attachments (1)

optimizer-fix.diff (599 bytes) - added by eriktorbjorn 16 years ago.
Patch against a May 19 CVS snapshot

Download all attachments as: .zip

Change History (4)

Changed 16 years ago by eriktorbjorn

Attachment: optimizer-fix.diff added

Patch against a May 19 CVS snapshot

comment:1 Changed 16 years ago by fingolfin

Good catch. No "?" needed, this code has undefined behaviour
depending on which system you run it. Compare also with
int a = (++b) * (b++);

comment:2 Changed 16 years ago by fingolfin

Owner: set to fingolfin
Status: newclosed

comment:3 Changed 7 months ago by digitall

Component: Engine: SCUMM
Game: The Dig
Note: See TracTickets for help on using tickets.