All of lore.kernel.org
 help / color / mirror / Atom feed
* Eliminating grub_size_t
@ 2008-07-02  2:14 Pavel Roskin
  2008-07-02  2:33 ` Javier Martín
  0 siblings, 1 reply; 15+ messages in thread
From: Pavel Roskin @ 2008-07-02  2:14 UTC (permalink / raw)
  To: The development of GRUB 2

Hello!

I wonder if we would be better off without grub_size_t.  I cannot think
of any code that could use it legitimately.

The ordinary size_t is used to represent the result of sizeof, i.e. size
of a structure.  There is no need for grub to support data structures
exceeding 4 gigabytes.  If we want to support more memory, that's fine,
but that would involve other types that can hold the pointer values,
such as long.

size_t has different size on 32-bit and 64-bit systems, but we should
strive to make the userspace utilities work like the bootloader, so that
possible problems can be detected early and debugged easily.

Besides, we cannot even print size_t in grub_printf(), and I don't think
we should.

grub_size_t should be replaced with int or grub_uint32_t.  size_t can be
used in pure userspace code to call functions that need it.

-- 
Regards,
Pavel Roskin



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-07-03 19:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02  2:14 Eliminating grub_size_t Pavel Roskin
2008-07-02  2:33 ` Javier Martín
2008-07-02  4:20   ` Pavel Roskin
2008-07-02 10:26     ` Isaac Dupree
2008-07-02 13:23       ` Pavel Roskin
2008-07-02 17:46     ` Vesa Jääskeläinen
2008-07-02 17:51       ` Pavel Roskin
2008-07-03 18:02         ` Marco Gerards
2008-07-03 18:29           ` Pavel Roskin
2008-07-03 18:42             ` Vesa Jääskeläinen
2008-07-03 18:52               ` Pavel Roskin
2008-07-03 19:07                 ` Vesa Jääskeläinen
2008-07-03 19:16                   ` Pavel Roskin
2008-07-03 18:56             ` Marco Gerards
2008-07-03 19:05               ` Pavel Roskin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.