Re: [REGRESSION PATCH] vsprintf: increase sizeof precision in printf_spec

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joe Perches
Date: Tuesday, April 13, 2010 - 6:33 pm

On Tue, 2010-04-13 at 21:13 -0400, Eric Paris wrote:

I don't see how it could be appropriately packed.

This is the structure now:

struct printf_spec {
	u16	type;
	s16	field_width;	/* width of output field */
	u8	flags;		/* flags to number() */
	u8	base;
	s8	precision;	/* # of digits/chars */
	u8	qualifier;
};

Adding another char should make the structure larger than 64 bits.

type isn't currently required to be u16.
It could be u8.

Perhaps this is better.

struct printf_spec {
	u8 type;
	u8 flags;		/* flags to number() */
	u8 base;
	u8 qualifier;
	s16 field_width;	/* width of output field */
	s16 precision;		/* # of digits/chars */
} __attribute__((packed));

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [REGRESSION PATCH] vsprintf: increase sizeof precision ..., Joe Perches, (Tue Apr 13, 6:33 pm)
Re: [REGRESSION PATCH] vsprintf: increase sizeof precision ..., Justin P. mattock, (Wed Apr 14, 7:40 am)
Re: [REGRESSION PATCH] vsprintf: increase sizeof precision ..., Frederic Weisbecker, (Wed Apr 14, 8:00 am)
Re: [REGRESSION PATCH V2] vsprintf: Change struct printf_s ..., Justin P. mattock, (Wed Apr 14, 9:47 am)