Opened 21 years ago

Closed 21 years ago

Last modified 6 years ago

#8227 closed patch

Fix for undefined (?) behaviour in fopenNoCase()

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Version: 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 21 years ago.
Patch against a May 19 CVS snapshot

Download all attachments as: .zip

Change History (4)

by eriktorbjorn, 21 years ago

Attachment: optimizer-fix.diff added

Patch against a May 19 CVS snapshot

comment:1 by fingolfin, 21 years ago

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 by fingolfin, 21 years ago

Owner: set to fingolfin
Status: newclosed

comment:3 by digitall, 6 years ago

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