------- Additional Comments From pcarlini at suse dot de 2005-09-07 16:51 ------- (In reply to comment #8) > Yes, you have a point that the mapping prescribed by the ISO/IEC Standards is > not very precise, because, strictly speaking, the C Standard speaks only about > unsigned int and the C++ Standard mandates "%x" for many different types (see > 22.2.2.2.2/Stage1): then the user is allowed to invoke undefined behavior if > he uses "hex" together with anything != unsigned int, that is, basically, > *always* because unsigned int is not among the types over which do_put is > overloaded! I consider this a defect of the C++ Standard and will take care > of reporting it to the LWG Commitee. Thanks for pointing it out!
Actually, the issue is less general and serious (i.e., restricted to the signedness issue, that allows the user to easily invoke undefined behavior from the underlying printf), because, anyway, according to Table 59, an 'l' will prefix the 'x' or 'X', in case of long or unsigned long. Sorry about the confusion. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23757