[Mono-devel-list] (AMD64) Compiler Warnings (2)

Willibald Krenn Willibald.Krenn at gmx.at
Mon Dec 6 18:35:15 EST 2004


Next revision..

   -> fixed some POINTER_TO_XXX casts that were wrong.
	(in debuger code, and IIRC mini.c, trace.c)
   -> renamed printf constants
   -> added description to intps.h
   -> intstd.h check thrown out again
   -> intps.h header does not need config.h anymore
   -> uintptr, intptr mapped to g[u]int32/64
   -> reverted some changed fields back to original
   -> removed one usage of printf constants (the one Paolo pointed out)
   -> removed extra casts

Attention: There is still some 'interface change' present in the patch: 
The debug event now takes an uintptr_t as data argument. (This is 
because ip addresses get assigned to that arg.)

Compiles fine on 37188.

>> Here and in other places like this, the correct thing to do is to 
>> change the code
>> to cast the pointer difference to an int:
>>     g_error ("Invalid IL code at IL%04x in %s: %s\n", (int)(ip - 
>> header->code),
>> because we're not going to have IL methods bigger than 2 gigabytes.

Small change in plan: Did not re-check all printf statements for this, 
  - I do not have that intimate knowledge of the code
  - more changes would introduce more errors
  - the additional digits won't get printed
  - cast could hide bug (casts are 'evil')
  - for most part if something changes size between 32 and 64 bit
    but should not, then the chosen datatype is wrong alltogether.
    (g[s]size comes to mind)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: clean64_0612_37188_rc6_mono.diff
Type: text/x-diff
Size: 38609 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20041207/48b4d04f/attachment.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: intps.h
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20041207/48b4d04f/attachment.h 

More information about the Mono-devel-list mailing list