Win32 Port of Safari

Alan Gutierrez ajglist at izzy.net
Fri Jan 10 12:27:00 GMT 2003


Simon Hausmann wrote:
 > On Thu, Jan 09, 2003 at 03:17:29PM -0600, Alan Gutierrez wrote:
 >
 >>Stephan Johach wrote:
 >>
 >>>The standard says i is only valid in the scope of the for construct, so i
 >>>is not declared for the printf().
 >>>
 >>>So expect more pitfalls. :)
 >>
 >>Yup. Hit this twice. Each time I took moved the variable declaration out of
 >>the for initalization.
 >>
 >>Really, the problems I encountered with the KHTML source have been minor.
 >>I'm sure we are going to want to discuss how to resolve the differences
 >>between the two compilers, but VC++ isn't being *too* much of a baby. It
 >>doesn't look like we are going to have to have excessive #ifdef nonsense.
 >
 > One other bug with VC++ you're going to run into at run-time are
 > bitfields with enums. khtml makes extensive use of them, VC++
 > compiles code using it without saying anything but essentially
 > miscompiles it, causing memory corruption at run-time. What I did
 > with the win32 port of konq/e was to remove the bitfield
 > definitions. The other option is to change the variables to int and
 > do a lot of casting then. (the latter is definitely preferred in
 > terms of memory usage ;) but a lot more work and pretty ugly in the
 > end patch wise)

Thank you for the warning. I would not have known.

I'd rather have pretty code than memory efficency at this point. Until it is
working with VC++, I'd like to keep the compiler specific lines to a minimum.
Don't want to worry about a hundred new casts added to code that I can yet
run. Optimize last.

Alan Gutierrez





More information about the kfm-devel mailing list