public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [regex] Provide a default definition of SIZE_MAX
@ 2005-12-06  8:50 Paolo Bonzini
  2005-12-11  5:59 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2005-12-06  8:50 UTC (permalink / raw)
  To: libc-hacker

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

regex is currently using SIZE_MAX.  However, first of all this is 
relying on stdint.h being included implicitly (via other headers) 
because that's where SIZE_MAX is defined.  Second, regex cannot rely on 
C99 headers.  This patch fixes this problem by providing a default 
definition of this macro.

Paolo

[-- Attachment #2: undefined-size-max.patch --]
[-- Type: text/plain, Size: 470 bytes --]

2005-12-06  Paolo Bonzini  <bonzini@gnu.org>

	* posix/regex_internal.h (SIZE_MAX): Provide a default definition.

--- regex_internal.h.old	2005-12-06 09:47:00.000000000 +0100
+++ regex_internal.h	2005-12-06 09:46:37.000000000 +0100
@@ -120,6 +120,10 @@
 # define __attribute(arg)
 #endif
 
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t)-1)
+#endif
+
 extern const char __re_error_msgid[] attribute_hidden;
 extern const size_t __re_error_msgid_idx[] attribute_hidden;
 

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

* Re: [regex] Provide a default definition of SIZE_MAX
  2005-12-06  8:50 [regex] Provide a default definition of SIZE_MAX Paolo Bonzini
@ 2005-12-11  5:59 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2005-12-11  5:59 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: libc-hacker

If you noticed stdint.h isn't included, why didn't you add this to the 
patch as well?  I've done this now and added the default definition.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

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

end of thread, other threads:[~2005-12-11  5:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-06  8:50 [regex] Provide a default definition of SIZE_MAX Paolo Bonzini
2005-12-11  5:59 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).