[Date Prev][Date Next] [Chronological] [Thread] [Top]

C API draft3: ber_tag_t and LBER_ERROR



I am thinking with the advent of ber_tag_t that the LBER_ERROR and
LBER_DEFAULT values may not be set appropriately.  Per 16.4:

#define LBER_ERROR	(ber_tag_t) 0xffffffff
#define LBER_DEFAULT	(ber_tag_t) 0xffffffff


On a 64-bit system, this is same as:

#define LBER_ERROR	(ber_tag_t) 0x00000000ffffffff
#define LBER_DEFAULT	(ber_tag_t) 0x00000000ffffffff


I'm thinking that these might macros might be better defined
to all bits 1.

#define LBER_ERROR	((ber_tag_t) ~0)
#define LBER_DEFAULT	((ber_tag_t) ~0)

Regradless, 16.4 should clearly state if 32 least significant
bits or all bits should 1.

Comments?
	- Kurt


PS: the the result of ber_scanf() in decode_example2() is called
despite possible previous errors and its result isn't checked.