Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 11 Mar 2012 08:02:59 -0500 Message-ID: <4F5CB0C8.2C88@mindspring.com> Date: Sun, 11 Mar 2012 09:03:52 -0500 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: Method to test a program against different C implementations References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 50 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.222.224 X-Trace: sv3-jsqlAPOjBH65Bed1W0KGKUWql3ZCgrP872YcxNqx/YdZvLd61NZ/EeJi6+iJjjVtbGAjKKLABvI4Og5!/P47m4qk94EwzomhvILDyRSvEOc0ym/QDpDzVagw2xj4OzScoK1JJLB/TLGt0Bh89gAWqBluuYuR!0lFAEOke7zI= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2084 Xref: csiph.com comp.lang.c:18531 Joachim Schmitz wrote: > > pozz wrote: > > We perfectly know that C implementations can be very different in > > terms of: > > - number of bits per byte > > #include > and use CHAR_BIT > > > - number of bytes per int > > sizeof(int); > > > - number of bytes per long > > sizeof(long) > > > - signed or unsigned char > > #include > and look at CHAR_BIT, CHAR_MAX and CHAR_MIN > > > - negative number implementation (two's or one's complement) #include fputs("Negative numbers are ", stdout); switch (-1 & 3) { case 1: puts ("sign and magnitude."); break; case 2: puts ("one's complement."); break; case 3 : puts("two's complement."); break; default : puts("something strange."); break; } > > - big or little endian or others > > http://c-faq.com/misc/endiantest.html > > > > Bye, Jojo -- pete