Mail Archives: djgpp/1999/09/01/08:31:45
Peter Restall (pete AT restall DOT net) wrote:
: Hi. I was just wondering whether there are any bugs in the 'sscanf()'
: library routine for DJGPP ? See, I've got some code that looks like this:
: sscanf(modedef, "%[^:]:%dx%d:%d:%d:%X:%X:%X",
: mode->name,
: (unsigned int *) ((u_shortint *) &mode->width),
: (unsigned int *) ((u_shortint *) &mode->height),
: (unsigned int *) ((u_shortint *) &mode->depth),
: (unsigned int *) ((u_shortint *) &mode->flags),
: (unsigned int *) ((u_shortint *) &seg),
: (unsigned int *) ((u_shortint *) &off),
: (unsigned int *) ((u_shortint *) &mode->num));
[Klippa, klapp, kluppit.]
: I've tried taking away the casts, but it still doesn't work. I've narrowed
: the problem area down to where I read the hex variables with '%X' --
: everything else can be read without corrupting the file-handle, but as soon
: as a single '%X' is parsed, my code pukes. No run-time or compile-time
: errors (I compiled with '-Wall -pedantic -O3 -ffast-math').
Well, remove the casts and compile with "-Wall". I think you'd get quite a
lot of warnings, yes? Correct them.
Pink Floyd, The Division Bell,
MartinS
- Raw text -