On Mon, Aug 31, 2009 at 04:14:34PM -0300, monipol wrote:
> On 31/08/2009, at 16:05, Alexander Hansen wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Jack Howarth wrote:
>>> Can someone help me to add a FAQ entry in...
>>>
>>> http://www.finkproject.org/faq/comp-general.php?phpLang=en
>>>
>>> concerning gcc error messages that are significant for
>>> 64-bit code compilations? In particular we need to add
>>> a question for...
>>>
>>> Q6.25: I get warnings "cast to pointer from integer of different
>>> size" or
>>> "initialization makes pointer from integer without a cast" when
>>> compiling
>>> at -m64.
>>>
>>> Errors of the form "cast to pointer from integer of different size"
>>> and
>>> "initialization makes pointer from integer without a cast" can cause
>>> latent
>>> bugs at -m64 since, if the size of the integer is greater than the
>>> pointer,
>>> unwanted sign extension could occur. For example...
>>>
>>> (unsigned long long)((void *)(0xdeadbeef)))
>>>
>>> could show the result as 0xffffffffdeadbeef instead of the intended
>>> 0xdeadbeef. The fix is just to cast the pointer uintptr_t first so
>>> that...
>>>
>>> if (xim_info->current_xics == (XContext) NULL)
>>>
>>> becomes...
>>>
>>> if (xim_info->current_xics == (XContext)(uintptr_t) NULL)
>>>
>>> to eliminate the incorrect cast and insure that the pointer is
>>> correctly used.
>>
>> That could be done, sure. Though that seems to me more like something
>> that maintainers might have a need for than casual users, the target
>> audience of the FAQ.
>
>
> How about creating a new document for maintainers, sort of a knowledge
> base? It could use the same structure our FAQ document uses.
>
>
> Cheers,
>
> --
> monipol
> http://finkers.wordpress.com
>
> Submitting a Fink bug report? Read this:
> http://www.finkproject.org/doc/netiquette/index.php
> http://finkers.wordpress.com/2009/06/03/bug-reports/
Monipol,
I would really like to also see fink enhanced to scan the
output of the CompileScript execution for instances of the
more critical warnings in maintenance mode. If fink in -m
could just alert the packager that a specific warning has
been observed, it would really help to get these addressed
since manually scanning through a log compile log can be
annoying. Specifically we should look for instances of
"cast to pointer from integer of different size",
"initialization makes pointer from integer without a cast",
"array subscript is above array bounds" (for FSF gcc compilers),
"dereferencing type-punned pointer will break strict-aliasing rules",
"type-punning may break strict-aliasing rules", etc. In the
case of the aliasing rules warnings, it would help with
code that uses swig wrappers for example that are not
strict-aliasing safe. I suspect with gcc-4.2.1 now the default
in Snow Leopard this will be a little more important (although
not as much if they had moved on to gcc 4.3 or 4.4 for the
system compiler).
Jack
Jack
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Fink-devel mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.devel
Subscription management:
https://lists.sourceforge.net/lists/listinfo/fink-devel