This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getopt.c: optarg should not be initialized


On 09/21/2010 10:11 AM, Christophe Lyon wrote:
Well, then, why glibc doesn't initialize optarg?

I don't know. We are free to copy that if we want, but POSIX does not require that we copy that.



The problem I faced is that, being un-initialized in user code,

Why? If your user code intends to override the libc getopt, then your user code must not use anything uninitialized. Fix your user code - just because it happened to work with glibc does not make it correct.


--
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]