------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1049

Petr Pisar <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]




--- Comment #28 from Petr Pisar <[email protected]>  2011-11-16 16:58:36 ---
(In reply to comment #27)
> On Wed, 16 Nov 2011, Petr Pisar wrote:
> > (In reply to comment #20)
> > > static const union { int i; char c; } order = { 1 }; /* initialisation 
> > > assigns
> > > first union member */
> > > 
> > > You can then simply check:
> > > 
> > > if (order.c == 1) {
> > >    /* little endian */
> > > } else {
> > >    /* big endian */
> > > }
> > > 
> > This wrongly assumes sizeof(int) != sizeof(char) and that both of them are
> > signed or unsigned.
> 
> True. I guess one could test for sizeof(unsigned int) == sizeof(unsigned
> char) and then try sizeof(unsigned long int) == sizeof(unsigned char)
> and if that is also true, give up!
> 
If you required POSIX or c99, then you could include <stdint.h> and use uint8_t
and uint16_t types.


-- 
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email

-- 
## List details at https://lists.exim.org/mailman/listinfo/pcre-dev 

Reply via email to