[Freeciv-Dev] Re: New Patch
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, 6 Feb 2002 16:19:06 +0100, Raimar Falke wrote:
>> There are indeed both kinds of warnings and my cast
>> to (long) is to be well justified.
>
>The original code works without warning as long as size_t isn't a
>long. There are no information about this in the C spec. To avoid this
>you can do a cast to int: "(int)sizeof(...)".
>
In turn your proposal would break if sizeof() is actually
of type long. (and it can't be casted perhaps...).
My solution is perhaps not perfect, just "better" and for most
systems it is fine. Printing size_t is a famous programming FAQ.
You don't need to teach me C programming, guys.
---
Alexander Mai
st002279@xxxxxxxxxxxxxxxxxxxxxx
- [Freeciv-Dev] New Patch, Alexander Mai, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Raimar Falke, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Alexander Mai, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Ben Webb, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Alexander Mai, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Raimar Falke, 2002/02/06
- [Freeciv-Dev] Re: New Patch,
Alexander Mai <=
- [Freeciv-Dev] Re: New Patch, Raimar Falke, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Alexander Mai, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Raimar Falke, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Tony Stuckey, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Alexander Mai, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Vasco Alexandre Da Silva Costa, 2002/02/06
- [Freeciv-Dev] Re: New Patch, Alexander Mai, 2002/02/07
- [Freeciv-Dev] Re: New Patch, Ben Webb, 2002/02/06
|
|