Date: Thu, 13 May 1999 19:21:07 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Pasi Franti cc: djgpp AT delorie DOT com, ageenko AT cs DOT joensuu DOT fi Subject: Re: Portability and size_t type related question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 13 May 1999, Pasi Franti wrote: > #include > #if (INT_MAX == 2147483647) > typedef int int32; > #elif (LONG_MAX == 2147483647) > typedef long int32; > #elif (SHRT_MAX == 2147483647) > typedef short int32; > #else > #error "No 32-bit type!" > #endif This is not very reliable. For example, if int is 16 bit, the first #if might give you a false hit due to overflow.