glibc/manual/lang.texi

1229 lines
47 KiB
Plaintext
Raw Permalink Normal View History

@c This node must have no pointers.
@node Language Features
@c @node Language Features, Library Summary, , Top
Update. 1998-07-10 18:14 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu> * manual/Makefile: Overhauled. Generate libc.texinfo from the chapter files. Exorcise the chapters, chapters-incl mess. Support inserting doc chapters from add-on modules. (chapters): New variable. (add-chapters): New variable. (appendices): New variable. (libc.texinfo): New target. (clean): Fix bugs. (realclean): Fix bugs. * manual/texis.awk: New file. * manual/libc-texinfo.sh: New file. * manual/libc-texinfo.in: New file. * manual/conf.texi (top @node): Remove next pointer. * manual/lang.texi (top @node): Remove prev pointer. * manual/job.texi (top @node): Add explicit pointers. * manual/message.texi (top @node): Add explicit pointers. * manual/nss.texi (top @node): Add explicit pointers. * manual/process.texi (top @node): Add explicit pointers. * manual/startup.texi (top @node): Add explicit pointers. * manual/terminal.texi (top @node): Add explicit pointers. * manual/users.texi (top @node): Add explicit pointers. * manual/arith.texi: Add %MENU% tag. * manual/conf.texi: Add %MENU% tag. * manual/contrib.texi: Add %MENU% tag. * manual/ctype.texi: Add %MENU% tag. * manual/errno.texi: Add %MENU% tag. * manual/filesys.texi: Add %MENU% tag. * manual/header.texi: Add %MENU% tag. * manual/install.texi: Add %MENU% tag. * manual/intro.texi: Add %MENU% tag. * manual/io.texi: Add %MENU% tag. * manual/job.texi: Add %MENU% tag. * manual/lang.texi: Add %MENU% tag. * manual/llio.texi: Add %MENU% tag. * manual/locale.texi: Add %MENU% tag. * manual/maint.texi: Add %MENU% tag. * manual/math.texi: Add %MENU% tag. * manual/mbyte.texi: Add %MENU% tag. * manual/memory.texi: Add %MENU% tag. * manual/message.texi: Add %MENU% tag. * manual/nss.texi: Add %MENU% tag. * manual/pattern.texi: Add %MENU% tag. * manual/pipe.texi: Add %MENU% tag. * manual/process.texi: Add %MENU% tag. * manual/search.texi: Add %MENU% tag. * manual/setjmp.texi: Add %MENU% tag. * manual/signal.texi: Add %MENU% tag. * manual/socket.texi: Add %MENU% tag. * manual/startup.texi: Add %MENU% tag. * manual/stdio.texi: Add %MENU% tag. * manual/string.texi: Add %MENU% tag. * manual/sysinfo.texi: Add %MENU% tag. * manual/terminal.texi: Add %MENU% tag. * manual/time.texi: Add %MENU% tag. * manual/users.texi: Add %MENU% tag. 1998-07-13 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/i386/dl-procinfo.h (x86_cap_flags): Update. 1998-07-11 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/unix/sysv/linux/recvmsg.c (__libc_recvmsg): Use ANSI style declaration to avoid warning. * sysdeps/unix/sysv/linux/sendmsg.c (__libc_sendmsg): Likewise. 1998-07-04 Mark Kettenis <kettenis@phys.uva.nl> * elf/rtld.c (process_dl_debug): Add missing continue. 1998-07-12 Mark Kettenis <kettenis@phys.uva.nl> * elf/rtld.c (_dl_skip_args): Make global because the Hurd startup code needs it. 1998-07-10 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makeconfig ($(common-objpfx)sysd-dirs): Write out definition of sysd-dirs-done. * Makerules: Don't generate version maps too early. ($(common-objpfx)sysd-versions): Force regeneration if the list of subdirs has changed. 1998-07-10 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dlfcn.h (DL_CALL_FCT): Use portable comma expression. 1998-07-11 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * iconv/gconv_db.c (gen_steps): Always set *handle and *nsteps. * iconv/gconv_dl.c (__gconv_find_shlib): Correct use of tfind return value. 1998-07-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dl-open.c (dl_open_worker): New function. (_dl_open): Call it to do the actual work while catching errors. * elf/dl-close.c (_dl_close): Only call termination function if the initialisation function was called. 1998-07-13 Ulrich Drepper <drepper@cygnus.com> * libio/libioP.h (_IO_cleanup_registration_needed): Use __PMT. Reported by Felix von Leitner <leitner@amdiv.de>. 1998-07-13 10:28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/rtld.c (process_dl_debug): Add missing continue. 1998-06-23 Mark Kettenis <kettenis@phys.uva.nl>
1998-07-13 14:29:13 +02:00
@c %MENU% C language features provided by the library
1995-02-18 02:27:10 +01:00
@appendix C Language Facilities in the Library
Some of the facilities implemented by the C library really should be
thought of as parts of the C language itself. These facilities ought to
be documented in the C Language Manual, not in the library manual; but
since we don't have the language manual yet, and documentation for these
features has been written, we are publishing it here.
@menu
* Consistency Checking:: Using @code{assert} to abort if
something ``impossible'' happens.
* Variadic Functions:: Defining functions with varying numbers
of args.
1995-02-18 02:27:10 +01:00
* Null Pointer Constant:: The macro @code{NULL}.
* Important Data Types:: Data types for object sizes.
* Data Type Measurements:: Parameters of data type representations.
@end menu
@node Consistency Checking
@section Explicitly Checking Internal Consistency
@cindex consistency checking
@cindex impossible events
@cindex assertions
When you're writing a program, it's often a good idea to put in checks
at strategic places for ``impossible'' errors or violations of basic
assumptions. These kinds of checks are helpful in debugging problems
with the interfaces between different parts of the program, for example.
1995-02-18 02:27:10 +01:00
@pindex assert.h
The @code{assert} macro, defined in the header file @file{assert.h},
provides a convenient way to abort the program while printing a message
about where in the program the error was detected.
@vindex NDEBUG
Once you think your program is debugged, you can disable the error
checks performed by the @code{assert} macro by recompiling with the
macro @code{NDEBUG} defined. This means you don't actually have to
change the program source code to disable these checks.
But disabling these consistency checks is undesirable unless they make
the program significantly slower. All else being equal, more error
checking is good no matter who is running the program. A wise user
would rather have a program crash, visibly, than have it return nonsense
without indicating anything might be wrong.
@deftypefn Macro void assert (int @var{expression})
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, assert.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asucorrupt{}}@acunsafe{@acsmem{} @aculock{} @acucorrupt{}}}
@c assert_fail_base calls asprintf, and fflushes stderr.
Verify the programmer's belief that @var{expression} is nonzero at
this point in the program.
1995-02-18 02:27:10 +01:00
If @code{NDEBUG} is not defined, @code{assert} tests the value of
@var{expression}. If it is false (zero), @code{assert} aborts the
program (@pxref{Aborting a Program}) after printing a message of the
form:
@smallexample
@file{@var{file}}:@var{linenum}: @var{function}: Assertion `@var{expression}' failed.
1995-02-18 02:27:10 +01:00
@end smallexample
@noindent
on the standard error stream @code{stderr} (@pxref{Standard Streams}).
The filename and line number are taken from the C preprocessor macros
@code{__FILE__} and @code{__LINE__} and specify where the call to
@code{assert} was made. When using the GNU C compiler, the name of
the function which calls @code{assert} is taken from the built-in
variable @code{__PRETTY_FUNCTION__}; with older compilers, the function
name and following colon are omitted.
1995-02-18 02:27:10 +01:00
If the preprocessor macro @code{NDEBUG} is defined before
1995-02-18 02:27:10 +01:00
@file{assert.h} is included, the @code{assert} macro is defined to do
absolutely nothing.
@strong{Warning:} Even the argument expression @var{expression} is not
evaluated if @code{NDEBUG} is in effect. So never use @code{assert}
with arguments that involve side effects. For example, @code{assert
(++i > 0);} is a bad idea, because @code{i} will not be incremented if
@code{NDEBUG} is defined.
@end deftypefn
Sometimes the ``impossible'' condition you want to check for is an error
return from an operating system function. Then it is useful to display
not only where the program crashes, but also what error was returned.
The @code{assert_perror} macro makes this easy.
@deftypefn Macro void assert_perror (int @var{errnum})
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{GNU, assert.h}
@safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{} @asucorrupt{}}@acunsafe{@acsmem{} @aculock{} @acucorrupt{}}}
@c assert_fail_base calls asprintf, and fflushes stderr.
Similar to @code{assert}, but verifies that @var{errnum} is zero.
If @code{NDEBUG} is not defined, @code{assert_perror} tests the value of
@var{errnum}. If it is nonzero, @code{assert_perror} aborts the program
after printing a message of the form:
@smallexample
@file{@var{file}}:@var{linenum}: @var{function}: @var{error text}
@end smallexample
@noindent
on the standard error stream. The file name, line number, and function
name are as for @code{assert}. The error text is the result of
@w{@code{strerror (@var{errnum})}}. @xref{Error Messages}.
Like @code{assert}, if @code{NDEBUG} is defined before @file{assert.h}
is included, the @code{assert_perror} macro does absolutely nothing. It
does not evaluate the argument, so @var{errnum} should not have any side
effects. It is best for @var{errnum} to be just a simple variable
reference; often it will be @code{errno}.
This macro is a GNU extension.
@end deftypefn
1995-02-18 02:27:10 +01:00
@strong{Usage note:} The @code{assert} facility is designed for
detecting @emph{internal inconsistency}; it is not suitable for
reporting invalid input or improper usage by the @emph{user} of the
1995-02-18 02:27:10 +01:00
program.
The information in the diagnostic messages printed by the @code{assert}
and @code{assert_perror} macro is intended to help you, the programmer,
track down the cause of a bug, but is not really useful for telling a user
of your program why his or her input was invalid or why a command could not
be carried out. What's more, your program should not abort when given
invalid input, as @code{assert} would do---it should exit with nonzero
status (@pxref{Exit Status}) after printing its error messages, or perhaps
read another command or move on to the next input file.
1995-02-18 02:27:10 +01:00
@xref{Error Messages}, for information on printing error messages for
problems that @emph{do not} represent bugs in the program.
@node Variadic Functions
@section Variadic Functions
@cindex variable number of arguments
@cindex variadic functions
@cindex optional arguments
update from main archive 961207 Sun Dec 8 06:56:49 1996 Ulrich Drepper <drepper@cygnus.com> * io/getwd.c: Use PATH_MAX not LOCAL_PATH_MAX. Fix typo in comment. * stdlib/canonicalize.c: Correct bugs in last change. Patch by HJ Lu. * libio/Makefile (routines): Remove ioprims. (aux): Remove cleanup. Add IO_DEBUG option for .o files. * libio/cleanups.c: Removed. * libio/ioprims.c: Removed. * libio/filedoalloc.c: More updates from libg++-2.8b5. * libio/fileops.c: Likewise. * libio/genops.c: Likewise. * libio/iolibio.h: Likewise. * libio/iopopen.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/memstream.c: Likewise. * libio/strfile.h: Likewise. * libio/vasprintf.c: Likewise. * libio/vsnprintf.c: Likewise. * libio/stdio.h: Define P_tmpdir only is __USE_SVID. * manual/arith.texi: Change references to ANSI C to ISO C. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/ctype.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/intro.texi. Likewise. * manual/io.texi: Likewise. * manual/lang.texi: Likewise. * manual/libc.texinfo: Likewise. * manual/locale.texi: Likewise. * manual/maint.texi: Likewise. * manual/mbyte.texi: Likewise. * manual/memory.texi: Likewise. * manual/process.texi: Likewise. * manual/process.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/time.texi: Likewise. * manual/locale.texi: Remove description of LC_RESPONSE and add LC_MESSAGES. * Makefile (subdirs): Change malloc in $(malloc). * config.make.in: Add variable malloc which is initialized from @malloc@. * configure.in: Add new option --enable-new-malloc to use new malloc. This is the default on Linux. * sysdeps/unix/sysv/linux/configure.in: Define malloc to new-malloc by default. * new-malloc/Makefile: New file. Improved malloc implementation. * new-malloc/malloc.c: Likewise. * new-malloc/malloc.h: Likewise. * new-malloc/mallocbug.c: Likewise. * new-malloc/obstack.c: Likewise. * new-malloc/obstack.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/Makefile: Compile ap.c with NO_MCHECK flag for now. * time/ap.c: Don't call mcheck if NO_MCHECK is defined. * resolv/Makefile: Add rule to rebuiild libresolv.so when libc.so changed. * stdio/feof.c: Update copyright. * stdio/stdio.h: Add field for lock to FILE structure. Add cast to *MAGIC constants to prevent warnings. * stdio-common/bug7.c: Correct test. Stream must not be closed twice. * stdlib/Makefile (routines): Add secure-getenv. * stdlib/secure-getenv.c: New file. __secure_getenv function moved to here from sysdeps/generic/getenv.c. Otherwise an application cannot replace the getenv function in the libc. * sysdeps/generic/getenv.c: Remove __secure_getenv function. * sysdeps/stub/getenv.c: Remove __secure_getenv alias. * sysdeps/mach/libc-lock.h: Define__libc_mutex_lock to __mutex_lock. * sysdeps/posix/fdopen.c: Update copyright. Don't use EXFUN. * time/test-tz.c: Comment fifth test out. PROBLEM. * time/tzset.c: De-ANSI-declfy. (__tzset): Don't increment pointer tz when no DST information is given. Sat Dec 7 23:47:54 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/libc-lock.h [_LIBC]: Add definition of __libc_mutex_lock. Patch by Thomas Bushnell. * sysdeps/unix/sysv/linux/timebits.h: Load <asm/param.h> only if __USE_MISC. * sysdeps/unix/sysv/linux/Dist: Add llseek.c. Sat Dec 7 12:18:56 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime (%c format): Remove %Z from default string. Reported by Paul Eggert * io/getwd.c: Don't apply getcwd on user supplied buffer.
1996-12-08 09:01:13 +01:00
@w{ISO C} defines a syntax for declaring a function to take a variable
1995-02-18 02:27:10 +01:00
number or type of arguments. (Such functions are referred to as
@dfn{varargs functions} or @dfn{variadic functions}.) However, the
language itself provides no mechanism for such functions to access their
non-required arguments; instead, you use the variable arguments macros
defined in @file{stdarg.h}.
This section describes how to declare variadic functions, how to write
them, and how to call them properly.
@strong{Compatibility Note:} Many older C dialects provide a similar,
but incompatible, mechanism for defining functions with variable numbers
of arguments, using @file{varargs.h}.
@menu
* Why Variadic:: Reasons for making functions take
variable arguments.
1995-02-18 02:27:10 +01:00
* How Variadic:: How to define and call variadic functions.
* Variadic Example:: A complete example.
@end menu
@node Why Variadic
@subsection Why Variadic Functions are Used
Ordinary C functions take a fixed number of arguments. When you define
a function, you specify the data type for each argument. Every call to
the function should supply the expected number of arguments, with types
that can be converted to the specified ones. Thus, if the function
@samp{foo} is declared with @code{int foo (int, char *);} then you must
call it with two arguments, a number (any kind will do) and a string
pointer.
But some functions perform operations that can meaningfully accept an
unlimited number of arguments.
In some cases a function can handle any number of values by operating on
all of them as a block. For example, consider a function that allocates
a one-dimensional array with @code{malloc} to hold a specified set of
values. This operation makes sense for any number of values, as long as
the length of the array corresponds to that number. Without facilities
for variable arguments, you would have to define a separate function for
each possible array size.
The library function @code{printf} (@pxref{Formatted Output}) is an
example of another class of function where variable arguments are
useful. This function prints its arguments (which can vary in type as
well as number) under the control of a format template string.
These are good reasons to define a @dfn{variadic} function which can
handle as many arguments as the caller chooses to pass.
Some functions such as @code{open} take a fixed set of arguments, but
update from main archive 961207 Sun Dec 8 06:56:49 1996 Ulrich Drepper <drepper@cygnus.com> * io/getwd.c: Use PATH_MAX not LOCAL_PATH_MAX. Fix typo in comment. * stdlib/canonicalize.c: Correct bugs in last change. Patch by HJ Lu. * libio/Makefile (routines): Remove ioprims. (aux): Remove cleanup. Add IO_DEBUG option for .o files. * libio/cleanups.c: Removed. * libio/ioprims.c: Removed. * libio/filedoalloc.c: More updates from libg++-2.8b5. * libio/fileops.c: Likewise. * libio/genops.c: Likewise. * libio/iolibio.h: Likewise. * libio/iopopen.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/memstream.c: Likewise. * libio/strfile.h: Likewise. * libio/vasprintf.c: Likewise. * libio/vsnprintf.c: Likewise. * libio/stdio.h: Define P_tmpdir only is __USE_SVID. * manual/arith.texi: Change references to ANSI C to ISO C. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/ctype.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/intro.texi. Likewise. * manual/io.texi: Likewise. * manual/lang.texi: Likewise. * manual/libc.texinfo: Likewise. * manual/locale.texi: Likewise. * manual/maint.texi: Likewise. * manual/mbyte.texi: Likewise. * manual/memory.texi: Likewise. * manual/process.texi: Likewise. * manual/process.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/time.texi: Likewise. * manual/locale.texi: Remove description of LC_RESPONSE and add LC_MESSAGES. * Makefile (subdirs): Change malloc in $(malloc). * config.make.in: Add variable malloc which is initialized from @malloc@. * configure.in: Add new option --enable-new-malloc to use new malloc. This is the default on Linux. * sysdeps/unix/sysv/linux/configure.in: Define malloc to new-malloc by default. * new-malloc/Makefile: New file. Improved malloc implementation. * new-malloc/malloc.c: Likewise. * new-malloc/malloc.h: Likewise. * new-malloc/mallocbug.c: Likewise. * new-malloc/obstack.c: Likewise. * new-malloc/obstack.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/Makefile: Compile ap.c with NO_MCHECK flag for now. * time/ap.c: Don't call mcheck if NO_MCHECK is defined. * resolv/Makefile: Add rule to rebuiild libresolv.so when libc.so changed. * stdio/feof.c: Update copyright. * stdio/stdio.h: Add field for lock to FILE structure. Add cast to *MAGIC constants to prevent warnings. * stdio-common/bug7.c: Correct test. Stream must not be closed twice. * stdlib/Makefile (routines): Add secure-getenv. * stdlib/secure-getenv.c: New file. __secure_getenv function moved to here from sysdeps/generic/getenv.c. Otherwise an application cannot replace the getenv function in the libc. * sysdeps/generic/getenv.c: Remove __secure_getenv function. * sysdeps/stub/getenv.c: Remove __secure_getenv alias. * sysdeps/mach/libc-lock.h: Define__libc_mutex_lock to __mutex_lock. * sysdeps/posix/fdopen.c: Update copyright. Don't use EXFUN. * time/test-tz.c: Comment fifth test out. PROBLEM. * time/tzset.c: De-ANSI-declfy. (__tzset): Don't increment pointer tz when no DST information is given. Sat Dec 7 23:47:54 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/libc-lock.h [_LIBC]: Add definition of __libc_mutex_lock. Patch by Thomas Bushnell. * sysdeps/unix/sysv/linux/timebits.h: Load <asm/param.h> only if __USE_MISC. * sysdeps/unix/sysv/linux/Dist: Add llseek.c. Sat Dec 7 12:18:56 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime (%c format): Remove %Z from default string. Reported by Paul Eggert * io/getwd.c: Don't apply getcwd on user supplied buffer.
1996-12-08 09:01:13 +01:00
occasionally ignore the last few. Strict adherence to @w{ISO C} requires
1995-02-18 02:27:10 +01:00
these functions to be defined as variadic; in practice, however, the GNU
C compiler and most other C compilers let you define such a function to
take a fixed set of arguments---the most it can ever use---and then only
@emph{declare} the function as variadic (or not declare its arguments
at all!).
@node How Variadic
@subsection How Variadic Functions are Defined and Used
Defining and using a variadic function involves three steps:
@itemize @bullet
@item
@emph{Define} the function as variadic, using an ellipsis
(@samp{@dots{}}) in the argument list, and using special macros to
access the variable arguments. @xref{Receiving Arguments}.
@item
@emph{Declare} the function as variadic, using a prototype with an
ellipsis (@samp{@dots{}}), in all the files which call it.
@xref{Variadic Prototypes}.
@item
@emph{Call} the function by writing the fixed arguments followed by the
additional variable arguments. @xref{Calling Variadics}.
@end itemize
@menu
* Variadic Prototypes:: How to make a prototype for a function
with variable arguments.
* Receiving Arguments:: Steps you must follow to access the
optional argument values.
* How Many Arguments:: How to decide whether there are more arguments.
1995-02-18 02:27:10 +01:00
* Calling Variadics:: Things you need to know about calling
variable arguments functions.
* Argument Macros:: Detailed specification of the macros
for accessing variable arguments.
@end menu
@node Variadic Prototypes
@subsubsection Syntax for Variable Arguments
@cindex function prototypes (variadic)
@cindex prototypes for variadic functions
@cindex variadic function prototypes
A function that accepts a variable number of arguments must be declared
with a prototype that says so. You write the fixed arguments as usual,
and then tack on @samp{@dots{}} to indicate the possibility of
update from main archive 961207 Sun Dec 8 06:56:49 1996 Ulrich Drepper <drepper@cygnus.com> * io/getwd.c: Use PATH_MAX not LOCAL_PATH_MAX. Fix typo in comment. * stdlib/canonicalize.c: Correct bugs in last change. Patch by HJ Lu. * libio/Makefile (routines): Remove ioprims. (aux): Remove cleanup. Add IO_DEBUG option for .o files. * libio/cleanups.c: Removed. * libio/ioprims.c: Removed. * libio/filedoalloc.c: More updates from libg++-2.8b5. * libio/fileops.c: Likewise. * libio/genops.c: Likewise. * libio/iolibio.h: Likewise. * libio/iopopen.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/memstream.c: Likewise. * libio/strfile.h: Likewise. * libio/vasprintf.c: Likewise. * libio/vsnprintf.c: Likewise. * libio/stdio.h: Define P_tmpdir only is __USE_SVID. * manual/arith.texi: Change references to ANSI C to ISO C. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/ctype.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/intro.texi. Likewise. * manual/io.texi: Likewise. * manual/lang.texi: Likewise. * manual/libc.texinfo: Likewise. * manual/locale.texi: Likewise. * manual/maint.texi: Likewise. * manual/mbyte.texi: Likewise. * manual/memory.texi: Likewise. * manual/process.texi: Likewise. * manual/process.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/time.texi: Likewise. * manual/locale.texi: Remove description of LC_RESPONSE and add LC_MESSAGES. * Makefile (subdirs): Change malloc in $(malloc). * config.make.in: Add variable malloc which is initialized from @malloc@. * configure.in: Add new option --enable-new-malloc to use new malloc. This is the default on Linux. * sysdeps/unix/sysv/linux/configure.in: Define malloc to new-malloc by default. * new-malloc/Makefile: New file. Improved malloc implementation. * new-malloc/malloc.c: Likewise. * new-malloc/malloc.h: Likewise. * new-malloc/mallocbug.c: Likewise. * new-malloc/obstack.c: Likewise. * new-malloc/obstack.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/Makefile: Compile ap.c with NO_MCHECK flag for now. * time/ap.c: Don't call mcheck if NO_MCHECK is defined. * resolv/Makefile: Add rule to rebuiild libresolv.so when libc.so changed. * stdio/feof.c: Update copyright. * stdio/stdio.h: Add field for lock to FILE structure. Add cast to *MAGIC constants to prevent warnings. * stdio-common/bug7.c: Correct test. Stream must not be closed twice. * stdlib/Makefile (routines): Add secure-getenv. * stdlib/secure-getenv.c: New file. __secure_getenv function moved to here from sysdeps/generic/getenv.c. Otherwise an application cannot replace the getenv function in the libc. * sysdeps/generic/getenv.c: Remove __secure_getenv function. * sysdeps/stub/getenv.c: Remove __secure_getenv alias. * sysdeps/mach/libc-lock.h: Define__libc_mutex_lock to __mutex_lock. * sysdeps/posix/fdopen.c: Update copyright. Don't use EXFUN. * time/test-tz.c: Comment fifth test out. PROBLEM. * time/tzset.c: De-ANSI-declfy. (__tzset): Don't increment pointer tz when no DST information is given. Sat Dec 7 23:47:54 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/libc-lock.h [_LIBC]: Add definition of __libc_mutex_lock. Patch by Thomas Bushnell. * sysdeps/unix/sysv/linux/timebits.h: Load <asm/param.h> only if __USE_MISC. * sysdeps/unix/sysv/linux/Dist: Add llseek.c. Sat Dec 7 12:18:56 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime (%c format): Remove %Z from default string. Reported by Paul Eggert * io/getwd.c: Don't apply getcwd on user supplied buffer.
1996-12-08 09:01:13 +01:00
additional arguments. The syntax of @w{ISO C} requires at least one fixed
1995-02-18 02:27:10 +01:00
argument before the @samp{@dots{}}. For example,
@smallexample
int
1995-02-18 02:27:10 +01:00
func (const char *a, int b, @dots{})
@{
@dots{}
@}
1995-02-18 02:27:10 +01:00
@end smallexample
@noindent
defines a function @code{func} which returns an @code{int} and takes two
required arguments, a @code{const char *} and an @code{int}. These are
followed by any number of anonymous arguments.
1995-02-18 02:27:10 +01:00
@strong{Portability note:} For some C compilers, the last required
argument must not be declared @code{register} in the function
definition. Furthermore, this argument's type must be
@dfn{self-promoting}: that is, the default promotions must not change
its type. This rules out array and function types, as well as
@code{float}, @code{char} (whether signed or not) and @w{@code{short int}}
update from main archive 961207 Sun Dec 8 06:56:49 1996 Ulrich Drepper <drepper@cygnus.com> * io/getwd.c: Use PATH_MAX not LOCAL_PATH_MAX. Fix typo in comment. * stdlib/canonicalize.c: Correct bugs in last change. Patch by HJ Lu. * libio/Makefile (routines): Remove ioprims. (aux): Remove cleanup. Add IO_DEBUG option for .o files. * libio/cleanups.c: Removed. * libio/ioprims.c: Removed. * libio/filedoalloc.c: More updates from libg++-2.8b5. * libio/fileops.c: Likewise. * libio/genops.c: Likewise. * libio/iolibio.h: Likewise. * libio/iopopen.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/memstream.c: Likewise. * libio/strfile.h: Likewise. * libio/vasprintf.c: Likewise. * libio/vsnprintf.c: Likewise. * libio/stdio.h: Define P_tmpdir only is __USE_SVID. * manual/arith.texi: Change references to ANSI C to ISO C. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/ctype.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/intro.texi. Likewise. * manual/io.texi: Likewise. * manual/lang.texi: Likewise. * manual/libc.texinfo: Likewise. * manual/locale.texi: Likewise. * manual/maint.texi: Likewise. * manual/mbyte.texi: Likewise. * manual/memory.texi: Likewise. * manual/process.texi: Likewise. * manual/process.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/time.texi: Likewise. * manual/locale.texi: Remove description of LC_RESPONSE and add LC_MESSAGES. * Makefile (subdirs): Change malloc in $(malloc). * config.make.in: Add variable malloc which is initialized from @malloc@. * configure.in: Add new option --enable-new-malloc to use new malloc. This is the default on Linux. * sysdeps/unix/sysv/linux/configure.in: Define malloc to new-malloc by default. * new-malloc/Makefile: New file. Improved malloc implementation. * new-malloc/malloc.c: Likewise. * new-malloc/malloc.h: Likewise. * new-malloc/mallocbug.c: Likewise. * new-malloc/obstack.c: Likewise. * new-malloc/obstack.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/Makefile: Compile ap.c with NO_MCHECK flag for now. * time/ap.c: Don't call mcheck if NO_MCHECK is defined. * resolv/Makefile: Add rule to rebuiild libresolv.so when libc.so changed. * stdio/feof.c: Update copyright. * stdio/stdio.h: Add field for lock to FILE structure. Add cast to *MAGIC constants to prevent warnings. * stdio-common/bug7.c: Correct test. Stream must not be closed twice. * stdlib/Makefile (routines): Add secure-getenv. * stdlib/secure-getenv.c: New file. __secure_getenv function moved to here from sysdeps/generic/getenv.c. Otherwise an application cannot replace the getenv function in the libc. * sysdeps/generic/getenv.c: Remove __secure_getenv function. * sysdeps/stub/getenv.c: Remove __secure_getenv alias. * sysdeps/mach/libc-lock.h: Define__libc_mutex_lock to __mutex_lock. * sysdeps/posix/fdopen.c: Update copyright. Don't use EXFUN. * time/test-tz.c: Comment fifth test out. PROBLEM. * time/tzset.c: De-ANSI-declfy. (__tzset): Don't increment pointer tz when no DST information is given. Sat Dec 7 23:47:54 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/libc-lock.h [_LIBC]: Add definition of __libc_mutex_lock. Patch by Thomas Bushnell. * sysdeps/unix/sysv/linux/timebits.h: Load <asm/param.h> only if __USE_MISC. * sysdeps/unix/sysv/linux/Dist: Add llseek.c. Sat Dec 7 12:18:56 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime (%c format): Remove %Z from default string. Reported by Paul Eggert * io/getwd.c: Don't apply getcwd on user supplied buffer.
1996-12-08 09:01:13 +01:00
(whether signed or not). This is actually an @w{ISO C} requirement.
1995-02-18 02:27:10 +01:00
@node Receiving Arguments
@subsubsection Receiving the Argument Values
@cindex variadic function argument access
@cindex arguments (variadic functions)
Ordinary fixed arguments have individual names, and you can use these
names to access their values. But optional arguments have no
names---nothing but @samp{@dots{}}. How can you access them?
@pindex stdarg.h
The only way to access them is sequentially, in the order they were
written, and you must use special macros from @file{stdarg.h} in the
following three step process:
@enumerate
@item
You initialize an argument pointer variable of type @code{va_list} using
@code{va_start}. The argument pointer when initialized points to the
first optional argument.
@item
You access the optional arguments by successive calls to @code{va_arg}.
The first call to @code{va_arg} gives you the first optional argument,
the next call gives you the second, and so on.
You can stop at any time if you wish to ignore any remaining optional
arguments. It is perfectly all right for a function to access fewer
arguments than were supplied in the call, but you will get garbage
values if you try to access too many arguments.
@item
You indicate that you are finished with the argument pointer variable by
calling @code{va_end}.
(In practice, with most C compilers, calling @code{va_end} does nothing.
This is always true in the GNU C compiler. But you might as well call
@code{va_end} just in case your program is someday compiled with a peculiar
compiler.)
1995-02-18 02:27:10 +01:00
@end enumerate
@xref{Argument Macros}, for the full definitions of @code{va_start},
1995-02-18 02:27:10 +01:00
@code{va_arg} and @code{va_end}.
Steps 1 and 3 must be performed in the function that accepts the
optional arguments. However, you can pass the @code{va_list} variable
as an argument to another function and perform all or part of step 2
there.
You can perform the entire sequence of three steps multiple times
1995-02-18 02:27:10 +01:00
within a single function invocation. If you want to ignore the optional
arguments, you can do these steps zero times.
You can have more than one argument pointer variable if you like. You
can initialize each variable with @code{va_start} when you wish, and
then you can fetch arguments with each argument pointer as you wish.
Each argument pointer variable will sequence through the same set of
argument values, but at its own pace.
@strong{Portability note:} With some compilers, once you pass an
argument pointer value to a subroutine, you must not keep using the same
argument pointer value after that subroutine returns. For full
portability, you should just pass it to @code{va_end}. This is actually
update from main archive 961207 Sun Dec 8 06:56:49 1996 Ulrich Drepper <drepper@cygnus.com> * io/getwd.c: Use PATH_MAX not LOCAL_PATH_MAX. Fix typo in comment. * stdlib/canonicalize.c: Correct bugs in last change. Patch by HJ Lu. * libio/Makefile (routines): Remove ioprims. (aux): Remove cleanup. Add IO_DEBUG option for .o files. * libio/cleanups.c: Removed. * libio/ioprims.c: Removed. * libio/filedoalloc.c: More updates from libg++-2.8b5. * libio/fileops.c: Likewise. * libio/genops.c: Likewise. * libio/iolibio.h: Likewise. * libio/iopopen.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/memstream.c: Likewise. * libio/strfile.h: Likewise. * libio/vasprintf.c: Likewise. * libio/vsnprintf.c: Likewise. * libio/stdio.h: Define P_tmpdir only is __USE_SVID. * manual/arith.texi: Change references to ANSI C to ISO C. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/ctype.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/intro.texi. Likewise. * manual/io.texi: Likewise. * manual/lang.texi: Likewise. * manual/libc.texinfo: Likewise. * manual/locale.texi: Likewise. * manual/maint.texi: Likewise. * manual/mbyte.texi: Likewise. * manual/memory.texi: Likewise. * manual/process.texi: Likewise. * manual/process.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/time.texi: Likewise. * manual/locale.texi: Remove description of LC_RESPONSE and add LC_MESSAGES. * Makefile (subdirs): Change malloc in $(malloc). * config.make.in: Add variable malloc which is initialized from @malloc@. * configure.in: Add new option --enable-new-malloc to use new malloc. This is the default on Linux. * sysdeps/unix/sysv/linux/configure.in: Define malloc to new-malloc by default. * new-malloc/Makefile: New file. Improved malloc implementation. * new-malloc/malloc.c: Likewise. * new-malloc/malloc.h: Likewise. * new-malloc/mallocbug.c: Likewise. * new-malloc/obstack.c: Likewise. * new-malloc/obstack.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/Makefile: Compile ap.c with NO_MCHECK flag for now. * time/ap.c: Don't call mcheck if NO_MCHECK is defined. * resolv/Makefile: Add rule to rebuiild libresolv.so when libc.so changed. * stdio/feof.c: Update copyright. * stdio/stdio.h: Add field for lock to FILE structure. Add cast to *MAGIC constants to prevent warnings. * stdio-common/bug7.c: Correct test. Stream must not be closed twice. * stdlib/Makefile (routines): Add secure-getenv. * stdlib/secure-getenv.c: New file. __secure_getenv function moved to here from sysdeps/generic/getenv.c. Otherwise an application cannot replace the getenv function in the libc. * sysdeps/generic/getenv.c: Remove __secure_getenv function. * sysdeps/stub/getenv.c: Remove __secure_getenv alias. * sysdeps/mach/libc-lock.h: Define__libc_mutex_lock to __mutex_lock. * sysdeps/posix/fdopen.c: Update copyright. Don't use EXFUN. * time/test-tz.c: Comment fifth test out. PROBLEM. * time/tzset.c: De-ANSI-declfy. (__tzset): Don't increment pointer tz when no DST information is given. Sat Dec 7 23:47:54 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/libc-lock.h [_LIBC]: Add definition of __libc_mutex_lock. Patch by Thomas Bushnell. * sysdeps/unix/sysv/linux/timebits.h: Load <asm/param.h> only if __USE_MISC. * sysdeps/unix/sysv/linux/Dist: Add llseek.c. Sat Dec 7 12:18:56 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime (%c format): Remove %Z from default string. Reported by Paul Eggert * io/getwd.c: Don't apply getcwd on user supplied buffer.
1996-12-08 09:01:13 +01:00
an @w{ISO C} requirement, but most ANSI C compilers work happily
1995-02-18 02:27:10 +01:00
regardless.
@node How Many Arguments
@subsubsection How Many Arguments Were Supplied
@cindex number of arguments passed
@cindex how many arguments
@cindex arguments, how many
There is no general way for a function to determine the number and type
of the optional arguments it was called with. So whoever designs the
function typically designs a convention for the caller to specify the number
and type of arguments. It is up to you to define an appropriate calling
convention for each variadic function, and write all calls accordingly.
1995-02-18 02:27:10 +01:00
One kind of calling convention is to pass the number of optional
arguments as one of the fixed arguments. This convention works provided
all of the optional arguments are of the same type.
A similar alternative is to have one of the required arguments be a bit
mask, with a bit for each possible purpose for which an optional
argument might be supplied. You would test the bits in a predefined
sequence; if the bit is set, fetch the value of the next argument,
otherwise use a default value.
A required argument can be used as a pattern to specify both the number
and types of the optional arguments. The format string argument to
@code{printf} is one example of this (@pxref{Formatted Output Functions}).
Another possibility is to pass an ``end marker'' value as the last
optional argument. For example, for a function that manipulates an
arbitrary number of pointer arguments, a null pointer might indicate the
end of the argument list. (This assumes that a null pointer isn't
otherwise meaningful to the function.) The @code{execl} function works
in just this way; see @ref{Executing a File}.
@node Calling Variadics
@subsubsection Calling Variadic Functions
@cindex variadic functions, calling
@cindex calling variadic functions
@cindex declaring variadic functions
You don't have to do anything special to call a variadic function.
Just put the arguments (required arguments, followed by optional ones)
inside parentheses, separated by commas, as usual. But you must declare
the function with a prototype and know how the argument values are converted.
1995-02-18 02:27:10 +01:00
In principle, functions that are @emph{defined} to be variadic must also
be @emph{declared} to be variadic using a function prototype whenever
you call them. (@xref{Variadic Prototypes}, for how.) This is because
some C compilers use a different calling convention to pass the same set
of argument values to a function depending on whether that function
takes variable arguments or fixed arguments.
In practice, the GNU C compiler always passes a given set of argument
types in the same way regardless of whether they are optional or
required. So, as long as the argument types are self-promoting, you can
safely omit declaring them. Usually it is a good idea to declare the
argument types for variadic functions, and indeed for all functions.
But there are a few functions which it is extremely convenient not to
have to declare as variadic---for example, @code{open} and
@code{printf}.
@cindex default argument promotions
@cindex argument promotion
Since the prototype doesn't specify types for optional arguments, in a
call to a variadic function the @dfn{default argument promotions} are
performed on the optional argument values. This means the objects of
type @code{char} or @w{@code{short int}} (whether signed or not) are
promoted to either @code{int} or @w{@code{unsigned int}}, as
appropriate; and that objects of type @code{float} are promoted to type
@code{double}. So, if the caller passes a @code{char} as an optional
argument, it is promoted to an @code{int}, and the function can access
1995-02-18 02:27:10 +01:00
it with @code{va_arg (@var{ap}, int)}.
Conversion of the required arguments is controlled by the function
prototype in the usual way: the argument expression is converted to the
declared argument type as if it were being assigned to a variable of
that type.
@node Argument Macros
@subsubsection Argument Access Macros
Here are descriptions of the macros used to retrieve variable arguments.
These macros are defined in the header file @file{stdarg.h}.
@pindex stdarg.h
@deftp {Data Type} va_list
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, stdarg.h}
1995-02-18 02:27:10 +01:00
The type @code{va_list} is used for argument pointer variables.
@end deftp
@deftypefn {Macro} void va_start (va_list @var{ap}, @var{last-required})
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, stdarg.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
@c This is no longer provided by glibc, but rather by the compiler.
1995-02-18 02:27:10 +01:00
This macro initializes the argument pointer variable @var{ap} to point
to the first of the optional arguments of the current function;
@var{last-required} must be the last required argument to the function.
@end deftypefn
@deftypefn {Macro} @var{type} va_arg (va_list @var{ap}, @var{type})
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, stdarg.h}
@safety{@prelim{}@mtsafe{@mtsrace{:ap}}@assafe{}@acunsafe{@acucorrupt{}}}
@c This is no longer provided by glibc, but rather by the compiler.
@c Unlike the other va_ macros, that either start/end the lifetime of
@c the va_list object or don't modify it, this one modifies ap, and it
@c may leave it in a partially updated state.
1995-02-18 02:27:10 +01:00
The @code{va_arg} macro returns the value of the next optional argument,
and modifies the value of @var{ap} to point to the subsequent argument.
Thus, successive uses of @code{va_arg} return successive optional
1995-02-18 02:27:10 +01:00
arguments.
The type of the value returned by @code{va_arg} is @var{type} as
specified in the call. @var{type} must be a self-promoting type (not
@code{char} or @code{short int} or @code{float}) that matches the type
of the actual argument.
@end deftypefn
@deftypefn {Macro} void va_end (va_list @var{ap})
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, stdarg.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
@c This is no longer provided by glibc, but rather by the compiler.
1995-02-18 02:27:10 +01:00
This ends the use of @var{ap}. After a @code{va_end} call, further
@code{va_arg} calls with the same @var{ap} may not work. You should invoke
@code{va_end} before returning from the function in which @code{va_start}
was invoked with the same @var{ap} argument.
In @theglibc{}, @code{va_end} does nothing, and you need not ever
1995-02-18 02:27:10 +01:00
use it except for reasons of portability.
1995-02-18 02:27:10 +01:00
@end deftypefn
Sometimes it is necessary to parse the list of parameters more than once
or one wants to remember a certain position in the parameter list. To
do this, one will have to make a copy of the current value of the
argument. But @code{va_list} is an opaque type and one cannot necessarily
assign the value of one variable of type @code{va_list} to another variable
of the same type.
@deftypefn {Macro} void va_copy (va_list @var{dest}, va_list @var{src})
@deftypefnx {Macro} void __va_copy (va_list @var{dest}, va_list @var{src})
@standardsx{va_copy, C99, stdarg.h}
@standardsx{__va_copy, GNU, stdarg.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
The @code{va_copy} macro allows copying of objects of type
@code{va_list} even if this is not an integral type. The argument pointer
in @var{dest} is initialized to point to the same argument as the
pointer in @var{src}.
@code{va_copy} was added in ISO C99. When building for strict
conformance to ISO C90 (@samp{gcc -std=c90}), it is not available.
GCC provides @code{__va_copy}, as an extension, in any standards mode;
before GCC 3.0, it was the only macro for this functionality.
These macros are no longer provided by @theglibc{}, but rather by the
compiler.
@end deftypefn
If you want to use @code{va_copy} and be portable to pre-C99 systems,
you should always be prepared for the
possibility that this macro will not be available. On architectures where a
simple assignment is invalid, hopefully @code{va_copy} @emph{will} be available,
so one should always write something like this if concerned about
pre-C99 portability:
@smallexample
@{
va_list ap, save;
@dots{}
#ifdef va_copy
va_copy (save, ap);
#else
save = ap;
#endif
@dots{}
@}
@end smallexample
1995-02-18 02:27:10 +01:00
@node Variadic Example
@subsection Example of a Variadic Function
Here is a complete sample function that accepts a variable number of
arguments. The first argument to the function is the count of remaining
arguments, which are added up and the result returned. While trivial,
this function is sufficient to illustrate how to use the variable
arguments facility.
@comment Yes, this example has been tested.
@smallexample
@include add.c.texi
@end smallexample
@node Null Pointer Constant
@section Null Pointer Constant
@cindex null pointer constant
The null pointer constant is guaranteed not to point to any real object.
You can assign it to any pointer variable since it has type @code{void
*}. The preferred way to write a null pointer constant is with
@code{NULL}.
@deftypevr Macro {void *} NULL
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, stddef.h}
1995-02-18 02:27:10 +01:00
This is a null pointer constant.
@end deftypevr
You can also use @code{0} or @code{(void *)0} as a null pointer
constant, but using @code{NULL} is cleaner because it makes the purpose
of the constant more evident.
If you use the null pointer constant as a function argument, then for
complete portability you should make sure that the function has a
prototype declaration. Otherwise, if the target machine has two
different pointer representations, the compiler won't know which
representation to use for that argument. You can avoid the problem by
explicitly casting the constant to the proper pointer type, but we
recommend instead adding a prototype for the function you are calling.
@node Important Data Types
@section Important Data Types
The result of subtracting two pointers in C is always an integer, but the
precise data type varies from C compiler to C compiler. Likewise, the
data type of the result of @code{sizeof} also varies between compilers.
ISO C defines standard aliases for these two types, so you can refer to
them in a portable fashion. They are defined in the header file
1995-02-18 02:27:10 +01:00
@file{stddef.h}.
@pindex stddef.h
@deftp {Data Type} ptrdiff_t
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, stddef.h}
1995-02-18 02:27:10 +01:00
This is the signed integer type of the result of subtracting two
pointers. For example, with the declaration @code{char *p1, *p2;}, the
expression @code{p2 - p1} is of type @code{ptrdiff_t}. This will
probably be one of the standard signed integer types (@w{@code{short
int}}, @code{int} or @w{@code{long int}}), but might be a nonstandard
type that exists only for this purpose.
@end deftp
@deftp {Data Type} size_t
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, stddef.h}
1995-02-18 02:27:10 +01:00
This is an unsigned integer type used to represent the sizes of objects.
The result of the @code{sizeof} operator is of this type, and functions
such as @code{malloc} (@pxref{Unconstrained Allocation}) and
@code{memcpy} (@pxref{Copying Strings and Arrays}) accept arguments of
this type to specify object sizes. On systems using @theglibc{}, this
will be @w{@code{unsigned int}} or @w{@code{unsigned long int}}.
1995-02-18 02:27:10 +01:00
@strong{Usage Note:} @code{size_t} is the preferred way to declare any
arguments or variables that hold the size of an object.
@end deftp
@strong{Compatibility Note:} Implementations of C before the advent of
update from main archive 961207 Sun Dec 8 06:56:49 1996 Ulrich Drepper <drepper@cygnus.com> * io/getwd.c: Use PATH_MAX not LOCAL_PATH_MAX. Fix typo in comment. * stdlib/canonicalize.c: Correct bugs in last change. Patch by HJ Lu. * libio/Makefile (routines): Remove ioprims. (aux): Remove cleanup. Add IO_DEBUG option for .o files. * libio/cleanups.c: Removed. * libio/ioprims.c: Removed. * libio/filedoalloc.c: More updates from libg++-2.8b5. * libio/fileops.c: Likewise. * libio/genops.c: Likewise. * libio/iolibio.h: Likewise. * libio/iopopen.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/memstream.c: Likewise. * libio/strfile.h: Likewise. * libio/vasprintf.c: Likewise. * libio/vsnprintf.c: Likewise. * libio/stdio.h: Define P_tmpdir only is __USE_SVID. * manual/arith.texi: Change references to ANSI C to ISO C. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/ctype.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/intro.texi. Likewise. * manual/io.texi: Likewise. * manual/lang.texi: Likewise. * manual/libc.texinfo: Likewise. * manual/locale.texi: Likewise. * manual/maint.texi: Likewise. * manual/mbyte.texi: Likewise. * manual/memory.texi: Likewise. * manual/process.texi: Likewise. * manual/process.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/time.texi: Likewise. * manual/locale.texi: Remove description of LC_RESPONSE and add LC_MESSAGES. * Makefile (subdirs): Change malloc in $(malloc). * config.make.in: Add variable malloc which is initialized from @malloc@. * configure.in: Add new option --enable-new-malloc to use new malloc. This is the default on Linux. * sysdeps/unix/sysv/linux/configure.in: Define malloc to new-malloc by default. * new-malloc/Makefile: New file. Improved malloc implementation. * new-malloc/malloc.c: Likewise. * new-malloc/malloc.h: Likewise. * new-malloc/mallocbug.c: Likewise. * new-malloc/obstack.c: Likewise. * new-malloc/obstack.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/Makefile: Compile ap.c with NO_MCHECK flag for now. * time/ap.c: Don't call mcheck if NO_MCHECK is defined. * resolv/Makefile: Add rule to rebuiild libresolv.so when libc.so changed. * stdio/feof.c: Update copyright. * stdio/stdio.h: Add field for lock to FILE structure. Add cast to *MAGIC constants to prevent warnings. * stdio-common/bug7.c: Correct test. Stream must not be closed twice. * stdlib/Makefile (routines): Add secure-getenv. * stdlib/secure-getenv.c: New file. __secure_getenv function moved to here from sysdeps/generic/getenv.c. Otherwise an application cannot replace the getenv function in the libc. * sysdeps/generic/getenv.c: Remove __secure_getenv function. * sysdeps/stub/getenv.c: Remove __secure_getenv alias. * sysdeps/mach/libc-lock.h: Define__libc_mutex_lock to __mutex_lock. * sysdeps/posix/fdopen.c: Update copyright. Don't use EXFUN. * time/test-tz.c: Comment fifth test out. PROBLEM. * time/tzset.c: De-ANSI-declfy. (__tzset): Don't increment pointer tz when no DST information is given. Sat Dec 7 23:47:54 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/libc-lock.h [_LIBC]: Add definition of __libc_mutex_lock. Patch by Thomas Bushnell. * sysdeps/unix/sysv/linux/timebits.h: Load <asm/param.h> only if __USE_MISC. * sysdeps/unix/sysv/linux/Dist: Add llseek.c. Sat Dec 7 12:18:56 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime (%c format): Remove %Z from default string. Reported by Paul Eggert * io/getwd.c: Don't apply getcwd on user supplied buffer.
1996-12-08 09:01:13 +01:00
@w{ISO C} generally used @code{unsigned int} for representing object sizes
1995-02-18 02:27:10 +01:00
and @code{int} for pointer subtraction results. They did not
necessarily define either @code{size_t} or @code{ptrdiff_t}. Unix
systems did define @code{size_t}, in @file{sys/types.h}, but the
definition was usually a signed type.
@node Data Type Measurements
@section Data Type Measurements
Most of the time, if you choose the proper C data type for each object
in your program, you need not be concerned with just how it is
represented or how many bits it uses. When you do need such
information, the C language itself does not provide a way to get it.
The header files @file{limits.h} and @file{float.h} contain macros
which give you this information in full detail.
@menu
* Width of Type:: How many bits does an integer type hold?
* Range of Type:: What are the largest and smallest values
that an integer type can hold?
* Floating Type Macros:: Parameters that measure the floating point types.
1995-02-18 02:27:10 +01:00
* Structure Measurement:: Getting measurements on structure types.
@end menu
@node Width of Type
@subsection Width of an Integer Type
1995-02-18 02:27:10 +01:00
@cindex integer type width
@cindex width of integer type
@cindex type measurements, integer
@pindex limits.h
TS 18661-1:2014 defines macros for the width of integer types (the
number of value and sign bits). One benefit of these macros is they
can be used in @code{#if} preprocessor directives, whereas
@code{sizeof} cannot. The following macros are defined in
@file{limits.h}.
Add <limits.h> integer width macros. TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. This patch adds the <limits.h> macros to glibc's header, with the <stdint.h> ones intended to be added in a separate patch (which would add to the NEWS entry created by this patch). I've also added these macros to GCC's headers for GCC 7, but definitions in glibc's <limits.h> are still useful for older GCC, for non-GNU compilers and for when it's _GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ that implies the macros should be defined since the GCC header only considers __STDC_WANT_IEC_60559_BFP_EXT__ (and for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding). Tested for x86_64 and x86. * include/limits.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (CHAR_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SHRT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (USHRT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (LLONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULLONG_WIDTH): Likewise. * manual/lang.texi (Width of Type): Document these macros. * stdlib/tst-width.c: New file. * stdlib/Makefile (tests): Add tst-width.
2016-09-19 14:25:36 +02:00
@vtable @code
Add <limits.h> integer width macros. TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. This patch adds the <limits.h> macros to glibc's header, with the <stdint.h> ones intended to be added in a separate patch (which would add to the NEWS entry created by this patch). I've also added these macros to GCC's headers for GCC 7, but definitions in glibc's <limits.h> are still useful for older GCC, for non-GNU compilers and for when it's _GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ that implies the macros should be defined since the GCC header only considers __STDC_WANT_IEC_60559_BFP_EXT__ (and for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding). Tested for x86_64 and x86. * include/limits.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (CHAR_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SHRT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (USHRT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (LLONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULLONG_WIDTH): Likewise. * manual/lang.texi (Width of Type): Document these macros. * stdlib/tst-width.c: New file. * stdlib/Makefile (tests): Add tst-width.
2016-09-19 14:25:36 +02:00
@item CHAR_WIDTH
@itemx SCHAR_WIDTH
@itemx UCHAR_WIDTH
@itemx SHRT_WIDTH
@itemx USHRT_WIDTH
@itemx INT_WIDTH
@itemx UINT_WIDTH
@itemx LONG_WIDTH
@itemx ULONG_WIDTH
@itemx LLONG_WIDTH
@itemx ULLONG_WIDTH
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
Add <limits.h> integer width macros. TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. This patch adds the <limits.h> macros to glibc's header, with the <stdint.h> ones intended to be added in a separate patch (which would add to the NEWS entry created by this patch). I've also added these macros to GCC's headers for GCC 7, but definitions in glibc's <limits.h> are still useful for older GCC, for non-GNU compilers and for when it's _GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ that implies the macros should be defined since the GCC header only considers __STDC_WANT_IEC_60559_BFP_EXT__ (and for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding). Tested for x86_64 and x86. * include/limits.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (CHAR_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SHRT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (USHRT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (LLONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULLONG_WIDTH): Likewise. * manual/lang.texi (Width of Type): Document these macros. * stdlib/tst-width.c: New file. * stdlib/Makefile (tests): Add tst-width.
2016-09-19 14:25:36 +02:00
These are the widths of the types @code{char}, @code{signed char},
@code{unsigned char}, @code{short int}, @code{unsigned short int},
@code{int}, @code{unsigned int}, @code{long int}, @code{unsigned long
int}, @code{long long int} and @code{unsigned long long int},
respectively.
@end vtable
Add <limits.h> integer width macros. TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. This patch adds the <limits.h> macros to glibc's header, with the <stdint.h> ones intended to be added in a separate patch (which would add to the NEWS entry created by this patch). I've also added these macros to GCC's headers for GCC 7, but definitions in glibc's <limits.h> are still useful for older GCC, for non-GNU compilers and for when it's _GNU_SOURCE rather than __STDC_WANT_IEC_60559_BFP_EXT__ that implies the macros should be defined since the GCC header only considers __STDC_WANT_IEC_60559_BFP_EXT__ (and for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding). Tested for x86_64 and x86. * include/limits.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (CHAR_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SHRT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (USHRT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (LLONG_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULLONG_WIDTH): Likewise. * manual/lang.texi (Width of Type): Document these macros. * stdlib/tst-width.c: New file. * stdlib/Makefile (tests): Add tst-width.
2016-09-19 14:25:36 +02:00
Add <stdint.h> integer width macros. TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. Having previously added the <limits.h> macros, this patch adds the <stdint.h> ones. I've also added these macros to GCC's headers for GCC 7, but for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding. Tested for x86_64 and x86. * sysdeps/generic/stdint.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT8_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (PTRDIFF_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIG_ATOMIC_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIZE_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WINT_WIDTH): Likewise. * manual/arith.texi (Integers): Document these macros for types specified by width properties. * manual/lang.texi (Width of Type): Document these macros for other standard typedefs. * stdlib/tst-width-stdint.c: New file. * stdlib/Makefile (tests): Add tst-width-stdint.
2016-09-21 19:06:36 +02:00
Further such macros are defined in @file{stdint.h}. Apart from those
for types specified by width (@pxref{Integers}), the following are
defined:
Add <stdint.h> integer width macros. TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. Having previously added the <limits.h> macros, this patch adds the <stdint.h> ones. I've also added these macros to GCC's headers for GCC 7, but for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding. Tested for x86_64 and x86. * sysdeps/generic/stdint.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT8_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (PTRDIFF_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIG_ATOMIC_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIZE_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WINT_WIDTH): Likewise. * manual/arith.texi (Integers): Document these macros for types specified by width properties. * manual/lang.texi (Width of Type): Document these macros for other standard typedefs. * stdlib/tst-width-stdint.c: New file. * stdlib/Makefile (tests): Add tst-width-stdint.
2016-09-21 19:06:36 +02:00
@vtable @code
Add <stdint.h> integer width macros. TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. Having previously added the <limits.h> macros, this patch adds the <stdint.h> ones. I've also added these macros to GCC's headers for GCC 7, but for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding. Tested for x86_64 and x86. * sysdeps/generic/stdint.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT8_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (PTRDIFF_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIG_ATOMIC_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIZE_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WINT_WIDTH): Likewise. * manual/arith.texi (Integers): Document these macros for types specified by width properties. * manual/lang.texi (Width of Type): Document these macros for other standard typedefs. * stdlib/tst-width-stdint.c: New file. * stdlib/Makefile (tests): Add tst-width-stdint.
2016-09-21 19:06:36 +02:00
@item INTPTR_WIDTH
@itemx UINTPTR_WIDTH
@itemx PTRDIFF_WIDTH
@itemx SIG_ATOMIC_WIDTH
@itemx SIZE_WIDTH
@itemx WCHAR_WIDTH
@itemx WINT_WIDTH
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, stdint.h}
Add <stdint.h> integer width macros. TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. Having previously added the <limits.h> macros, this patch adds the <stdint.h> ones. I've also added these macros to GCC's headers for GCC 7, but for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding. Tested for x86_64 and x86. * sysdeps/generic/stdint.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT8_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (PTRDIFF_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIG_ATOMIC_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIZE_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WINT_WIDTH): Likewise. * manual/arith.texi (Integers): Document these macros for types specified by width properties. * manual/lang.texi (Width of Type): Document these macros for other standard typedefs. * stdlib/tst-width-stdint.c: New file. * stdlib/Makefile (tests): Add tst-width-stdint.
2016-09-21 19:06:36 +02:00
These are the widths of the types @code{intptr_t}, @code{uintptr_t},
@code{ptrdiff_t}, @code{sig_atomic_t}, @code{size_t}, @code{wchar_t}
and @code{wint_t}, respectively.
@end vtable
Add <stdint.h> integer width macros. TS 18661-1 defines macros for the width of integer types, intended for use with the fromfp functions to convert from floating-point types to integer types of any width, in any rounding mode and with control over whether "inexact" is raised. Such macros are, of course, more generally useful than just with those functions. Those macros are added to <limits.h> and <stdint.h>. Having previously added the <limits.h> macros, this patch adds the <stdint.h> ones. I've also added these macros to GCC's headers for GCC 7, but for glibc systems, the definitions in GCC's <stdint.h> will only be used with -ffreestanding. Tested for x86_64 and x86. * sysdeps/generic/stdint.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT8_WIDTH): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_LEAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST8_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST16_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST32_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINT_FAST64_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTPTR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (INTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (UINTMAX_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (PTRDIFF_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIG_ATOMIC_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (SIZE_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WCHAR_WIDTH): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (WINT_WIDTH): Likewise. * manual/arith.texi (Integers): Document these macros for types specified by width properties. * manual/lang.texi (Width of Type): Document these macros for other standard typedefs. * stdlib/tst-width-stdint.c: New file. * stdlib/Makefile (tests): Add tst-width-stdint.
2016-09-21 19:06:36 +02:00
A common reason that a program needs to know how many bits are in an
integer type is for using an array of @code{unsigned long int} as a
bit vector. You can access the bit at index @var{n} with:
@smallexample
vector[@var{n} / ULONG_WIDTH] & (1UL << (@var{n} % ULONG_WIDTH))
@end smallexample
Before @code{ULONG_WIDTH} was a part of the C language,
@code{CHAR_BIT} was used to compute the number of bits in an integer
data type.
@deftypevr Macro int CHAR_BIT
@standards{C90, limits.h}
This is the number of bits in a @code{char}. POSIX.1-2001 requires
this to be 8.
@end deftypevr
The number of bits in any data type @var{type} can be computed like
this:
@smallexample
sizeof (@var{type}) * CHAR_BIT
@end smallexample
That expression includes padding bits as well as value and sign bits.
On all systems supported by @theglibc{}, standard integer types other
than @code{_Bool} do not have any padding bits.
@strong{Portability Note:} One cannot actually easily compute the
number of usable bits in a portable manner.
1995-02-18 02:27:10 +01:00
@node Range of Type
@subsection Range of an Integer Type
@cindex integer type range
@cindex range of integer type
@cindex limits, integer types
Suppose you need to store an integer value which can range from zero to
one million. Which is the smallest type you can use? There is no
general rule; it depends on the C compiler and target machine. You can
use the @samp{MIN} and @samp{MAX} macros in @file{limits.h} to determine
which type will work.
Each signed integer type has a pair of macros which give the smallest
and largest values that it can hold. Each unsigned integer type has one
such macro, for the maximum value; the minimum value is, of course,
zero.
The values of these macros are all integer constant expressions. The
@samp{MAX} and @samp{MIN} macros for @code{char} and @w{@code{short
int}} types have values of type @code{int}. The @samp{MAX} and
@samp{MIN} macros for the other types have values of the same type
described by the macro---thus, @code{ULONG_MAX} has type
@w{@code{unsigned long int}}.
@comment Extra blank lines make it look better.
Update. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * hurd/Makefile (routines): Add cthreads. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * login/login.c (login): Let pututline take care of finding the positin to insert the UTMP entry. This corrects a bug where ssh was not reusing UTMP entries marked as DEAD_PROCESS. Reported by Herbert Xu <herbert@gondor.apana.org.au>. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * login/Makefile (tests): New variable, add tst-utmp and tst-utmpx. * login/tst-utmp.c: New file. * login/tst-utmpx.c: New file. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/mach/hurd/errlist.c (sys_nerr, _sys_nerr): Make weak aliases for _hurd_nerr, for programs that don't use sys_errlist, but need sys_err. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/generic/updwtmpx.c: Rename function to updwtmpx. * libc.map: Add updwtmpx and utmpxname to GLIBC_2.1. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/read.c: Rename function to __libc_read and make __read a weak alias. Use ANSI-style function definition. * sysdeps/mach/hurd/write.c: Likewise. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/err_hurd.sub: Use _hurd_errlist instead of _sys_errlist. 1998-05-30 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/Makefile ($(objpfx)librtld.os): Renamed from librtld.so. 1998-06-02 Andreas Jaeger <aj@arthur.rhein-neckar.de> * libc.map: Remove _IO_getline_info which was erroneously introduced in section GLIBC_2.0. Noticed by Horst von Brand <vonbrand@sleipnir.valparaiso.cl>. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/generic/socket.c (__socket): Renamed from socket, and created a weak alias. * sysdeps/mach/hurd/socket.c (__socket): Likewise. 1998-05-31 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/mach/hurd/ftruncate.c (__ftruncate): Rename from old ftruncate function, and create a weak alias to ftruncate. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * grp/fgetgrent_r.c: Use &errno instead of __errno_location (). * inet/getnetgrent_r.c: Likewise. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * pwd/fgetpwent_r.c: Likewise. * shadow/sgetspent_r.c: Likewise. * shadow/fgetspent_r.c: Likewise. * sunrpc/publickey.c: Likewise. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * hurd/libhurduser.map: New file. * mach/libmachuser.map: Likewise. * libc.map: Add Hurd-specific functions to version 2.1. Add __flshfp and __fillbf. 1998-05-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * manual/signal.texi (Basic Signal Handling): Fix typo. * manual/errno.texi (Error Codes): Likewise. 1998-06-02 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/netipx/ipx.h: Include <bits/sockaddr.h> instead of <sys/socket.h>. Patch by NIIBE Yutaka <gniibe@mri.co.jp> * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c (DL_FIND_ARG_COMPONENTS): Finally make it working. Patch by Mark Hatle <fray@kernel.crashing.org>. 1998-03-22 Paul Eggert <eggert@twinsun.com> * posix/regex.c: Include <wchar.h> before <wctype.h>, to work around a Solaris 2.6 bug.
1998-06-02 14:58:14 +02:00
@vtable @code
1995-02-18 02:27:10 +01:00
@item SCHAR_MIN
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
This is the minimum value that can be represented by a @w{@code{signed char}}.
@item SCHAR_MAX
@itemx UCHAR_MAX
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
These are the maximum values that can be represented by a
@w{@code{signed char}} and @w{@code{unsigned char}}, respectively.
@item CHAR_MIN
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
This is the minimum value that can be represented by a @code{char}.
It's equal to @code{SCHAR_MIN} if @code{char} is signed, or zero
otherwise.
@item CHAR_MAX
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
This is the maximum value that can be represented by a @code{char}.
It's equal to @code{SCHAR_MAX} if @code{char} is signed, or
@code{UCHAR_MAX} otherwise.
@item SHRT_MIN
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
This is the minimum value that can be represented by a @w{@code{signed
short int}}. On most machines that @theglibc{} runs on,
1995-02-18 02:27:10 +01:00
@code{short} integers are 16-bit quantities.
@item SHRT_MAX
@itemx USHRT_MAX
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
These are the maximum values that can be represented by a
@w{@code{signed short int}} and @w{@code{unsigned short int}},
respectively.
@item INT_MIN
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
This is the minimum value that can be represented by a @w{@code{signed
int}}. On most machines that @theglibc{} runs on, an @code{int} is
1995-02-18 02:27:10 +01:00
a 32-bit quantity.
@item INT_MAX
@itemx UINT_MAX
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
These are the maximum values that can be represented by, respectively,
the type @w{@code{signed int}} and the type @w{@code{unsigned int}}.
@item LONG_MIN
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
This is the minimum value that can be represented by a @w{@code{signed
long int}}. On most machines that @theglibc{} runs on, @code{long}
1995-02-18 02:27:10 +01:00
integers are 32-bit quantities, the same size as @code{int}.
@item LONG_MAX
@itemx ULONG_MAX
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
These are the maximum values that can be represented by a
@w{@code{signed long int}} and @code{unsigned long int}, respectively.
@item LLONG_MIN
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
This is the minimum value that can be represented by a @w{@code{signed
long long int}}. On most machines that @theglibc{} runs on,
1995-02-18 02:27:10 +01:00
@w{@code{long long}} integers are 64-bit quantities.
@item LLONG_MAX
@itemx ULLONG_MAX
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, limits.h}
1995-02-18 02:27:10 +01:00
These are the maximum values that can be represented by a @code{signed
long long int} and @code{unsigned long long int}, respectively.
@item LONG_LONG_MIN
@itemx LONG_LONG_MAX
@itemx ULONG_LONG_MAX
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{GNU, limits.h}
These are obsolete names for @code{LLONG_MIN}, @code{LLONG_MAX}, and
@code{ULLONG_MAX}. They are only available if @code{_GNU_SOURCE} is
defined (@pxref{Feature Test Macros}). In GCC versions prior to 3.0,
these were the only names available.
1995-02-18 02:27:10 +01:00
@item WCHAR_MAX
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{GNU, limits.h}
1995-02-18 02:27:10 +01:00
This is the maximum value that can be represented by a @code{wchar_t}.
Update. 1999-01-11 Ulrich Drepper <drepper@cygnus.com> * ctype/Versions [GLIBC_2.0]: Export __ctype32_b. * include/wctype.h: Declare __iswctype. * stdio-common/vfscanf.c (__vfscanf): Use __iswspace instead of iswspace. * wctype/Makefile (routines): Add wcextra_l. * wctype/wcextra.c (iswblank): Implement function here and don't use __iswctype. (__iswblank_l): Move definition to... * wctype/wcextra_l.c: ...here. New file. * wctype/wcfuncs.c: Really implement functions and don't call __iswctype or __towctrans. * wctype/wctype.h: Change isw* and tow* macros. Don't call __iswctype or __towctrans. Instead optimize constant argument case. * iconv/gconv.h: Fix typos. * iconv/skeleton.c: Fix typos. Optimize init function a bit. Correctly emit escape sequence to return to initial state in conversion function. * iconvdata/iso-2022-jp.c (gconv_init): Correctly initialize max_needed_to element. * manual/mbyte.texi: Removed. This is now described in charset.texi. * manual/charset.texi: New file. * manual/Makefile (chapters): Replace mbyte by charset. * manual/ctype.texi: Document wide character functions. * manual/intro.texi: Fix reference to mbyte chapter. * manual/lang.texi: Likewise. * manual/locale.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Fix @node line for new charset chapter. * manual/libc.texinfo (UPDATED): Updated. Also update copyright years. * manual/memory.texi (savestring): Optimize code to give a good example. * manual/filesys.texi: Fix wording. Patches by Jim Meyering. * nscd/nscd_getgr_r.c: Include stdint.h to get uintptr_t definition. * nscd/nscd_getpw_r.c: Likewise. * nscd/nscd_gethst_r.c: Likewise. * stdlib/stdtold_l.c: Always include xlocale.h. 1999-01-11 Geoffrey Keating <geoffk@ozemail.com.au> * stdlib/fpioconst.h (LDBL_MAX_10_EXP_LOG): Define to be same as DBL_MAX_10_EXP_LOG if there is no long double. (_fpioconst_pow10): Always use size as LDBL_MAX_10_EXP_LOG to match printf_fp.c. 1999-01-10 Andreas Jaeger <aj@arthur.rhein-neckar.de> * timezone/Makefile ($(testdata)/GB): Changed to ... ($(testdata)/Europe/London): ... for tst-timezone test. ($(objpfx)tst-timezone.out): Change GB to Europe/London. * timezone/tst-timezone.c (main): Enable DST switching test, change GB to Europe/London. 1999-01-10 Philip Blundell <philb@gnu.org> * socket/Makefile (headers): Remove bits/sockunion.h. 1999-01-09 Philip Blundell <philb@gnu.org> * socket/sys/socket.h: Don't include <bits/sockunion.h>. * sysdeps/generic/bits/sockunion.h: Deleted. * sysdeps/unix/sysv/linux/bits/sockunion.h: Likewise. 1999-01-08 H.J. Lu <hjl@gnu.org> * io/fts.c (fts_close): Don't access memory after having it freed.
1999-01-11 21:13:43 +01:00
@xref{Extended Char Intro}.
@end vtable
1995-02-18 02:27:10 +01:00
The header file @file{limits.h} also defines some additional constants
that parameterize various operating system and file system limits. These
constants are described in @ref{System Configuration}.
@node Floating Type Macros
@subsection Floating Type Macros
@cindex floating type measurements
@cindex measurements of floating types
@cindex type measurements, floating
@cindex limits, floating types
The specific representation of floating point numbers varies from
machine to machine. Because floating point numbers are represented
internally as approximate quantities, algorithms for manipulating
floating point data often need to take account of the precise details of
the machine's floating point representation.
Some of the functions in the C library itself need this information; for
example, the algorithms for printing and reading floating point numbers
(@pxref{I/O on Streams}) and for calculating trigonometric and
irrational functions (@pxref{Mathematics}) use it to avoid round-off
error and loss of accuracy. User programs that implement numerical
analysis techniques also often need this information in order to
minimize or compute error bounds.
The header file @file{float.h} describes the format used by your
machine.
@menu
* Floating Point Concepts:: Definitions of terminology.
* Floating Point Parameters:: Details of specific macros.
* IEEE Floating Point:: The measurements for one common
representation.
1995-02-18 02:27:10 +01:00
@end menu
@node Floating Point Concepts
@subsubsection Floating Point Representation Concepts
This section introduces the terminology for describing floating point
representations.
You are probably already familiar with most of these concepts in terms
of scientific or exponential notation for floating point numbers. For
example, the number @code{123456.0} could be expressed in exponential
notation as @code{1.23456e+05}, a shorthand notation indicating that the
mantissa @code{1.23456} is multiplied by the base @code{10} raised to
power @code{5}.
More formally, the internal representation of a floating point number
can be characterized in terms of the following parameters:
@itemize @bullet
@item
@cindex sign (of floating point number)
The @dfn{sign} is either @code{-1} or @code{1}.
@item
@cindex base (of floating point number)
@cindex radix (of floating point number)
The @dfn{base} or @dfn{radix} for exponentiation, an integer greater
than @code{1}. This is a constant for a particular representation.
@item
@cindex exponent (of floating point number)
The @dfn{exponent} to which the base is raised. The upper and lower
bounds of the exponent value are constants for a particular
representation.
@cindex bias (of floating point number exponent)
Sometimes, in the actual bits representing the floating point number,
the exponent is @dfn{biased} by adding a constant to it, to make it
always be represented as an unsigned quantity. This is only important
if you have some reason to pick apart the bit fields making up the
floating point number by hand, which is something for which @theglibc{}
provides no support. So this is ignored in the discussion that
1995-02-18 02:27:10 +01:00
follows.
@item
@cindex mantissa (of floating point number)
@cindex significand (of floating point number)
The @dfn{mantissa} or @dfn{significand} is an unsigned integer which is a
1995-02-18 02:27:10 +01:00
part of each floating point number.
@item
1995-02-18 02:27:10 +01:00
@cindex precision (of floating point number)
The @dfn{precision} of the mantissa. If the base of the representation
is @var{b}, then the precision is the number of base-@var{b} digits in
the mantissa. This is a constant for a particular representation.
@cindex hidden bit (of floating point number mantissa)
Many floating point representations have an implicit @dfn{hidden bit} in
the mantissa. This is a bit which is present virtually in the mantissa,
but not stored in memory because its value is always 1 in a normalized
number. The precision figure (see above) includes any hidden bits.
Again, @theglibc{} provides no facilities for dealing with such
1995-02-18 02:27:10 +01:00
low-level aspects of the representation.
@end itemize
The mantissa of a floating point number represents an implicit fraction
whose denominator is the base raised to the power of the precision. Since
the largest representable mantissa is one less than this denominator, the
value of the fraction is always strictly less than @code{1}. The
mathematical value of a floating point number is then the product of this
fraction, the sign, and the base raised to the exponent.
1995-02-18 02:27:10 +01:00
@cindex normalized floating point number
We say that the floating point number is @dfn{normalized} if the
fraction is at least @code{1/@var{b}}, where @var{b} is the base. In
other words, the mantissa would be too large to fit if it were
multiplied by the base. Non-normalized numbers are sometimes called
@dfn{denormal}; they contain less precision than the representation
normally can hold.
If the number is not normalized, then you can subtract @code{1} from the
exponent while multiplying the mantissa by the base, and get another
floating point number with the same value. @dfn{Normalization} consists
of doing this repeatedly until the number is normalized. Two distinct
normalized floating point numbers cannot be equal in value.
(There is an exception to this rule: if the mantissa is zero, it is
considered normalized. Another exception happens on certain machines
where the exponent is as small as the representation can hold. Then
it is impossible to subtract @code{1} from the exponent, so a number
may be normalized even if its fraction is less than @code{1/@var{b}}.)
@node Floating Point Parameters
@subsubsection Floating Point Parameters
@pindex float.h
These macro definitions can be accessed by including the header file
@file{float.h} in your program.
Macro names starting with @samp{FLT_} refer to the @code{float} type,
while names beginning with @samp{DBL_} refer to the @code{double} type
and names beginning with @samp{LDBL_} refer to the @code{long double}
type. (If GCC does not support @code{long double} as a distinct data
type on a target machine then the values for the @samp{LDBL_} constants
are equal to the corresponding constants for the @code{double} type.)
1995-02-18 02:27:10 +01:00
Of these macros, only @code{FLT_RADIX} is guaranteed to be a constant
expression. The other macros listed here cannot be reliably used in
places that require constant expressions, such as @samp{#if}
preprocessing directives or in the dimensions of static arrays.
update from main archive 961207 Sun Dec 8 06:56:49 1996 Ulrich Drepper <drepper@cygnus.com> * io/getwd.c: Use PATH_MAX not LOCAL_PATH_MAX. Fix typo in comment. * stdlib/canonicalize.c: Correct bugs in last change. Patch by HJ Lu. * libio/Makefile (routines): Remove ioprims. (aux): Remove cleanup. Add IO_DEBUG option for .o files. * libio/cleanups.c: Removed. * libio/ioprims.c: Removed. * libio/filedoalloc.c: More updates from libg++-2.8b5. * libio/fileops.c: Likewise. * libio/genops.c: Likewise. * libio/iolibio.h: Likewise. * libio/iopopen.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/memstream.c: Likewise. * libio/strfile.h: Likewise. * libio/vasprintf.c: Likewise. * libio/vsnprintf.c: Likewise. * libio/stdio.h: Define P_tmpdir only is __USE_SVID. * manual/arith.texi: Change references to ANSI C to ISO C. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/ctype.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/intro.texi. Likewise. * manual/io.texi: Likewise. * manual/lang.texi: Likewise. * manual/libc.texinfo: Likewise. * manual/locale.texi: Likewise. * manual/maint.texi: Likewise. * manual/mbyte.texi: Likewise. * manual/memory.texi: Likewise. * manual/process.texi: Likewise. * manual/process.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/time.texi: Likewise. * manual/locale.texi: Remove description of LC_RESPONSE and add LC_MESSAGES. * Makefile (subdirs): Change malloc in $(malloc). * config.make.in: Add variable malloc which is initialized from @malloc@. * configure.in: Add new option --enable-new-malloc to use new malloc. This is the default on Linux. * sysdeps/unix/sysv/linux/configure.in: Define malloc to new-malloc by default. * new-malloc/Makefile: New file. Improved malloc implementation. * new-malloc/malloc.c: Likewise. * new-malloc/malloc.h: Likewise. * new-malloc/mallocbug.c: Likewise. * new-malloc/obstack.c: Likewise. * new-malloc/obstack.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/Makefile: Compile ap.c with NO_MCHECK flag for now. * time/ap.c: Don't call mcheck if NO_MCHECK is defined. * resolv/Makefile: Add rule to rebuiild libresolv.so when libc.so changed. * stdio/feof.c: Update copyright. * stdio/stdio.h: Add field for lock to FILE structure. Add cast to *MAGIC constants to prevent warnings. * stdio-common/bug7.c: Correct test. Stream must not be closed twice. * stdlib/Makefile (routines): Add secure-getenv. * stdlib/secure-getenv.c: New file. __secure_getenv function moved to here from sysdeps/generic/getenv.c. Otherwise an application cannot replace the getenv function in the libc. * sysdeps/generic/getenv.c: Remove __secure_getenv function. * sysdeps/stub/getenv.c: Remove __secure_getenv alias. * sysdeps/mach/libc-lock.h: Define__libc_mutex_lock to __mutex_lock. * sysdeps/posix/fdopen.c: Update copyright. Don't use EXFUN. * time/test-tz.c: Comment fifth test out. PROBLEM. * time/tzset.c: De-ANSI-declfy. (__tzset): Don't increment pointer tz when no DST information is given. Sat Dec 7 23:47:54 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/libc-lock.h [_LIBC]: Add definition of __libc_mutex_lock. Patch by Thomas Bushnell. * sysdeps/unix/sysv/linux/timebits.h: Load <asm/param.h> only if __USE_MISC. * sysdeps/unix/sysv/linux/Dist: Add llseek.c. Sat Dec 7 12:18:56 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime (%c format): Remove %Z from default string. Reported by Paul Eggert * io/getwd.c: Don't apply getcwd on user supplied buffer.
1996-12-08 09:01:13 +01:00
Although the @w{ISO C} standard specifies minimum and maximum values for
1995-02-18 02:27:10 +01:00
most of these parameters, the GNU C implementation uses whatever values
describe the floating point representation of the target machine. So in
update from main archive 961207 Sun Dec 8 06:56:49 1996 Ulrich Drepper <drepper@cygnus.com> * io/getwd.c: Use PATH_MAX not LOCAL_PATH_MAX. Fix typo in comment. * stdlib/canonicalize.c: Correct bugs in last change. Patch by HJ Lu. * libio/Makefile (routines): Remove ioprims. (aux): Remove cleanup. Add IO_DEBUG option for .o files. * libio/cleanups.c: Removed. * libio/ioprims.c: Removed. * libio/filedoalloc.c: More updates from libg++-2.8b5. * libio/fileops.c: Likewise. * libio/genops.c: Likewise. * libio/iolibio.h: Likewise. * libio/iopopen.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/memstream.c: Likewise. * libio/strfile.h: Likewise. * libio/vasprintf.c: Likewise. * libio/vsnprintf.c: Likewise. * libio/stdio.h: Define P_tmpdir only is __USE_SVID. * manual/arith.texi: Change references to ANSI C to ISO C. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/ctype.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/intro.texi. Likewise. * manual/io.texi: Likewise. * manual/lang.texi: Likewise. * manual/libc.texinfo: Likewise. * manual/locale.texi: Likewise. * manual/maint.texi: Likewise. * manual/mbyte.texi: Likewise. * manual/memory.texi: Likewise. * manual/process.texi: Likewise. * manual/process.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/time.texi: Likewise. * manual/locale.texi: Remove description of LC_RESPONSE and add LC_MESSAGES. * Makefile (subdirs): Change malloc in $(malloc). * config.make.in: Add variable malloc which is initialized from @malloc@. * configure.in: Add new option --enable-new-malloc to use new malloc. This is the default on Linux. * sysdeps/unix/sysv/linux/configure.in: Define malloc to new-malloc by default. * new-malloc/Makefile: New file. Improved malloc implementation. * new-malloc/malloc.c: Likewise. * new-malloc/malloc.h: Likewise. * new-malloc/mallocbug.c: Likewise. * new-malloc/obstack.c: Likewise. * new-malloc/obstack.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/Makefile: Compile ap.c with NO_MCHECK flag for now. * time/ap.c: Don't call mcheck if NO_MCHECK is defined. * resolv/Makefile: Add rule to rebuiild libresolv.so when libc.so changed. * stdio/feof.c: Update copyright. * stdio/stdio.h: Add field for lock to FILE structure. Add cast to *MAGIC constants to prevent warnings. * stdio-common/bug7.c: Correct test. Stream must not be closed twice. * stdlib/Makefile (routines): Add secure-getenv. * stdlib/secure-getenv.c: New file. __secure_getenv function moved to here from sysdeps/generic/getenv.c. Otherwise an application cannot replace the getenv function in the libc. * sysdeps/generic/getenv.c: Remove __secure_getenv function. * sysdeps/stub/getenv.c: Remove __secure_getenv alias. * sysdeps/mach/libc-lock.h: Define__libc_mutex_lock to __mutex_lock. * sysdeps/posix/fdopen.c: Update copyright. Don't use EXFUN. * time/test-tz.c: Comment fifth test out. PROBLEM. * time/tzset.c: De-ANSI-declfy. (__tzset): Don't increment pointer tz when no DST information is given. Sat Dec 7 23:47:54 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/libc-lock.h [_LIBC]: Add definition of __libc_mutex_lock. Patch by Thomas Bushnell. * sysdeps/unix/sysv/linux/timebits.h: Load <asm/param.h> only if __USE_MISC. * sysdeps/unix/sysv/linux/Dist: Add llseek.c. Sat Dec 7 12:18:56 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime (%c format): Remove %Z from default string. Reported by Paul Eggert * io/getwd.c: Don't apply getcwd on user supplied buffer.
1996-12-08 09:01:13 +01:00
principle GNU C actually satisfies the @w{ISO C} requirements only if the
1995-02-18 02:27:10 +01:00
target machine is suitable. In practice, all the machines currently
supported are suitable.
Update. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * hurd/Makefile (routines): Add cthreads. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * login/login.c (login): Let pututline take care of finding the positin to insert the UTMP entry. This corrects a bug where ssh was not reusing UTMP entries marked as DEAD_PROCESS. Reported by Herbert Xu <herbert@gondor.apana.org.au>. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * login/Makefile (tests): New variable, add tst-utmp and tst-utmpx. * login/tst-utmp.c: New file. * login/tst-utmpx.c: New file. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/mach/hurd/errlist.c (sys_nerr, _sys_nerr): Make weak aliases for _hurd_nerr, for programs that don't use sys_errlist, but need sys_err. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/generic/updwtmpx.c: Rename function to updwtmpx. * libc.map: Add updwtmpx and utmpxname to GLIBC_2.1. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/read.c: Rename function to __libc_read and make __read a weak alias. Use ANSI-style function definition. * sysdeps/mach/hurd/write.c: Likewise. 1998-05-31 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/err_hurd.sub: Use _hurd_errlist instead of _sys_errlist. 1998-05-30 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/Makefile ($(objpfx)librtld.os): Renamed from librtld.so. 1998-06-02 Andreas Jaeger <aj@arthur.rhein-neckar.de> * libc.map: Remove _IO_getline_info which was erroneously introduced in section GLIBC_2.0. Noticed by Horst von Brand <vonbrand@sleipnir.valparaiso.cl>. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/generic/socket.c (__socket): Renamed from socket, and created a weak alias. * sysdeps/mach/hurd/socket.c (__socket): Likewise. 1998-05-31 Gordon Matzigkeit <gord@profitpress.com> * sysdeps/mach/hurd/ftruncate.c (__ftruncate): Rename from old ftruncate function, and create a weak alias to ftruncate. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * grp/fgetgrent_r.c: Use &errno instead of __errno_location (). * inet/getnetgrent_r.c: Likewise. * nss/getXXbyYY_r.c: Likewise. * nss/getXXent_r.c: Likewise. * pwd/fgetpwent_r.c: Likewise. * shadow/sgetspent_r.c: Likewise. * shadow/fgetspent_r.c: Likewise. * sunrpc/publickey.c: Likewise. 1998-06-01 Gordon Matzigkeit <gord@profitpress.com> * hurd/libhurduser.map: New file. * mach/libmachuser.map: Likewise. * libc.map: Add Hurd-specific functions to version 2.1. Add __flshfp and __fillbf. 1998-05-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * manual/signal.texi (Basic Signal Handling): Fix typo. * manual/errno.texi (Error Codes): Likewise. 1998-06-02 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/netipx/ipx.h: Include <bits/sockaddr.h> instead of <sys/socket.h>. Patch by NIIBE Yutaka <gniibe@mri.co.jp> * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c (DL_FIND_ARG_COMPONENTS): Finally make it working. Patch by Mark Hatle <fray@kernel.crashing.org>. 1998-03-22 Paul Eggert <eggert@twinsun.com> * posix/regex.c: Include <wchar.h> before <wctype.h>, to work around a Solaris 2.6 bug.
1998-06-02 14:58:14 +02:00
@vtable @code
1995-02-18 02:27:10 +01:00
@item FLT_ROUNDS
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
This value characterizes the rounding mode for floating point addition.
The following values indicate standard rounding modes:
@need 750
@table @code
@item -1
The mode is indeterminable.
@item 0
Rounding is towards zero.
@item 1
Rounding is to the nearest number.
@item 2
Rounding is towards positive infinity.
@item 3
Rounding is towards negative infinity.
@end table
@noindent
Any other value represents a machine-dependent nonstandard rounding
mode.
On most machines, the value is @code{1}, in accordance with the IEEE
standard for floating point.
Here is a table showing how certain values round for each possible value
of @code{FLT_ROUNDS}, if the other aspects of the representation match
the IEEE single-precision standard.
@smallexample
0 1 2 3
1.00000003 1.0 1.0 1.00000012 1.0
1.00000007 1.0 1.00000012 1.00000012 1.0
-1.00000003 -1.0 -1.0 -1.0 -1.00000012
-1.00000007 -1.0 -1.00000012 -1.0 -1.00000012
@end smallexample
@item FLT_RADIX
@standards{C90, float.h}
This is the value of the base, or radix, of the exponent representation.
1995-02-18 02:27:10 +01:00
This is guaranteed to be a constant expression, unlike the other macros
described in this section. The value is 2 on all machines we know of
except the IBM 360 and derivatives.
@item FLT_MANT_DIG
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
This is the number of base-@code{FLT_RADIX} digits in the floating point
mantissa for the @code{float} data type. The following expression
yields @code{1.0} (even though mathematically it should not) due to the
limited number of mantissa digits:
@smallexample
float radix = FLT_RADIX;
1.0f + 1.0f / radix / radix / @dots{} / radix
@end smallexample
@noindent
where @code{radix} appears @code{FLT_MANT_DIG} times.
@item DBL_MANT_DIG
@itemx LDBL_MANT_DIG
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
This is the number of base-@code{FLT_RADIX} digits in the floating point
mantissa for the data types @code{double} and @code{long double},
respectively.
@comment Extra blank lines make it look better.
@item FLT_DIG
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
This is the number of decimal digits of precision for the @code{float}
data type. Technically, if @var{p} and @var{b} are the precision and
base (respectively) for the representation, then the decimal precision
@var{q} is the maximum number of decimal digits such that any floating
point number with @var{q} base 10 digits can be rounded to a floating
point number with @var{p} base @var{b} digits and back again, without
change to the @var{q} decimal digits.
The value of this macro is supposed to be at least @code{6}, to satisfy
update from main archive 961207 Sun Dec 8 06:56:49 1996 Ulrich Drepper <drepper@cygnus.com> * io/getwd.c: Use PATH_MAX not LOCAL_PATH_MAX. Fix typo in comment. * stdlib/canonicalize.c: Correct bugs in last change. Patch by HJ Lu. * libio/Makefile (routines): Remove ioprims. (aux): Remove cleanup. Add IO_DEBUG option for .o files. * libio/cleanups.c: Removed. * libio/ioprims.c: Removed. * libio/filedoalloc.c: More updates from libg++-2.8b5. * libio/fileops.c: Likewise. * libio/genops.c: Likewise. * libio/iolibio.h: Likewise. * libio/iopopen.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/memstream.c: Likewise. * libio/strfile.h: Likewise. * libio/vasprintf.c: Likewise. * libio/vsnprintf.c: Likewise. * libio/stdio.h: Define P_tmpdir only is __USE_SVID. * manual/arith.texi: Change references to ANSI C to ISO C. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/ctype.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/intro.texi. Likewise. * manual/io.texi: Likewise. * manual/lang.texi: Likewise. * manual/libc.texinfo: Likewise. * manual/locale.texi: Likewise. * manual/maint.texi: Likewise. * manual/mbyte.texi: Likewise. * manual/memory.texi: Likewise. * manual/process.texi: Likewise. * manual/process.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/time.texi: Likewise. * manual/locale.texi: Remove description of LC_RESPONSE and add LC_MESSAGES. * Makefile (subdirs): Change malloc in $(malloc). * config.make.in: Add variable malloc which is initialized from @malloc@. * configure.in: Add new option --enable-new-malloc to use new malloc. This is the default on Linux. * sysdeps/unix/sysv/linux/configure.in: Define malloc to new-malloc by default. * new-malloc/Makefile: New file. Improved malloc implementation. * new-malloc/malloc.c: Likewise. * new-malloc/malloc.h: Likewise. * new-malloc/mallocbug.c: Likewise. * new-malloc/obstack.c: Likewise. * new-malloc/obstack.h: Likewise. * new-malloc/thread-m.h: Likewise. * time/Makefile: Compile ap.c with NO_MCHECK flag for now. * time/ap.c: Don't call mcheck if NO_MCHECK is defined. * resolv/Makefile: Add rule to rebuiild libresolv.so when libc.so changed. * stdio/feof.c: Update copyright. * stdio/stdio.h: Add field for lock to FILE structure. Add cast to *MAGIC constants to prevent warnings. * stdio-common/bug7.c: Correct test. Stream must not be closed twice. * stdlib/Makefile (routines): Add secure-getenv. * stdlib/secure-getenv.c: New file. __secure_getenv function moved to here from sysdeps/generic/getenv.c. Otherwise an application cannot replace the getenv function in the libc. * sysdeps/generic/getenv.c: Remove __secure_getenv function. * sysdeps/stub/getenv.c: Remove __secure_getenv alias. * sysdeps/mach/libc-lock.h: Define__libc_mutex_lock to __mutex_lock. * sysdeps/posix/fdopen.c: Update copyright. Don't use EXFUN. * time/test-tz.c: Comment fifth test out. PROBLEM. * time/tzset.c: De-ANSI-declfy. (__tzset): Don't increment pointer tz when no DST information is given. Sat Dec 7 23:47:54 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/mach/libc-lock.h [_LIBC]: Add definition of __libc_mutex_lock. Patch by Thomas Bushnell. * sysdeps/unix/sysv/linux/timebits.h: Load <asm/param.h> only if __USE_MISC. * sysdeps/unix/sysv/linux/Dist: Add llseek.c. Sat Dec 7 12:18:56 1996 Ulrich Drepper <drepper@cygnus.com> * time/strftime (%c format): Remove %Z from default string. Reported by Paul Eggert * io/getwd.c: Don't apply getcwd on user supplied buffer.
1996-12-08 09:01:13 +01:00
@w{ISO C}.
1995-02-18 02:27:10 +01:00
@item DBL_DIG
@itemx LDBL_DIG
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
These are similar to @code{FLT_DIG}, but for the data types
@code{double} and @code{long double}, respectively. The values of these
macros are supposed to be at least @code{10}.
@item FLT_MIN_EXP
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
This is the smallest possible exponent value for type @code{float}.
More precisely, it is the minimum negative integer such that the value
1995-02-18 02:27:10 +01:00
@code{FLT_RADIX} raised to this power minus 1 can be represented as a
normalized floating point number of type @code{float}.
@item DBL_MIN_EXP
@itemx LDBL_MIN_EXP
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
These are similar to @code{FLT_MIN_EXP}, but for the data types
@code{double} and @code{long double}, respectively.
@item FLT_MIN_10_EXP
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
This is the minimum negative integer such that @code{10} raised to this
power minus 1 can be represented as a normalized floating point number
of type @code{float}. This is supposed to be @code{-37} or even less.
@item DBL_MIN_10_EXP
@itemx LDBL_MIN_10_EXP
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
These are similar to @code{FLT_MIN_10_EXP}, but for the data types
@code{double} and @code{long double}, respectively.
@item FLT_MAX_EXP
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
This is the largest possible exponent value for type @code{float}. More
precisely, this is the maximum positive integer such that value
@code{FLT_RADIX} raised to this power minus 1 can be represented as a
floating point number of type @code{float}.
@item DBL_MAX_EXP
@itemx LDBL_MAX_EXP
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
These are similar to @code{FLT_MAX_EXP}, but for the data types
@code{double} and @code{long double}, respectively.
@item FLT_MAX_10_EXP
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
This is the maximum positive integer such that @code{10} raised to this
power minus 1 can be represented as a normalized floating point number
of type @code{float}. This is supposed to be at least @code{37}.
@item DBL_MAX_10_EXP
@itemx LDBL_MAX_10_EXP
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
These are similar to @code{FLT_MAX_10_EXP}, but for the data types
@code{double} and @code{long double}, respectively.
@item FLT_MAX
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
The value of this macro is the maximum number representable in type
@code{float}. It is supposed to be at least @code{1E+37}. The value
has type @code{float}.
The smallest representable number is @code{- FLT_MAX}.
@item DBL_MAX
@itemx LDBL_MAX
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
These are similar to @code{FLT_MAX}, but for the data types
@code{double} and @code{long double}, respectively. The type of the
macro's value is the same as the type it describes.
@item FLT_MIN
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
The value of this macro is the minimum normalized positive floating
point number that is representable in type @code{float}. It is supposed
to be no more than @code{1E-37}.
@item DBL_MIN
@itemx LDBL_MIN
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
These are similar to @code{FLT_MIN}, but for the data types
@code{double} and @code{long double}, respectively. The type of the
macro's value is the same as the type it describes.
@item FLT_EPSILON
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
2012-02-18 00:46:51 +01:00
This is the difference between 1 and the smallest floating point
number of type @code{float} that is greater than 1. It's supposed to
1995-02-18 02:27:10 +01:00
be no greater than @code{1E-5}.
@item DBL_EPSILON
@itemx LDBL_EPSILON
@standards{C90, float.h}
1995-02-18 02:27:10 +01:00
These are similar to @code{FLT_EPSILON}, but for the data types
@code{double} and @code{long double}, respectively. The type of the
macro's value is the same as the type it describes. The values are not
supposed to be greater than @code{1E-9}.
@end vtable
1995-02-18 02:27:10 +01:00
@node IEEE Floating Point
@subsubsection IEEE Floating Point
@cindex IEEE floating point representation
1995-02-18 02:27:10 +01:00
@cindex floating point, IEEE
Here is an example showing how the floating type measurements come out
for the most common floating point representation, specified by the
@cite{IEEE Standard for Binary Floating Point Arithmetic (ANSI/IEEE Std
754-1985)}. Nearly all computers designed since the 1980s use this
format.
The IEEE single-precision float representation uses a base of 2. There
is a sign bit, a mantissa with 23 bits plus one hidden bit (so the total
precision is 24 base-2 digits), and an 8-bit exponent that can represent
values in the range -125 to 128, inclusive.
So, for an implementation that uses this representation for the
@code{float} data type, appropriate values for the corresponding
parameters are:
@smallexample
FLT_RADIX 2
FLT_MANT_DIG 24
FLT_DIG 6
FLT_MIN_EXP -125
FLT_MIN_10_EXP -37
FLT_MAX_EXP 128
FLT_MAX_10_EXP +38
FLT_MIN 1.17549435E-38F
FLT_MAX 3.40282347E+38F
FLT_EPSILON 1.19209290E-07F
@end smallexample
Here are the values for the @code{double} data type:
@smallexample
DBL_MANT_DIG 53
DBL_DIG 15
DBL_MIN_EXP -1021
DBL_MIN_10_EXP -307
DBL_MAX_EXP 1024
DBL_MAX_10_EXP 308
DBL_MAX 1.7976931348623157E+308
DBL_MIN 2.2250738585072014E-308
DBL_EPSILON 2.2204460492503131E-016
@end smallexample
@node Structure Measurement
@subsection Structure Field Offset Measurement
You can use @code{offsetof} to measure the location within a structure
type of a particular structure member.
@deftypefn {Macro} size_t offsetof (@var{type}, @var{member})
manual: Replace summary.awk with summary.pl. The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
2017-06-16 06:12:39 +02:00
@standards{ISO, stddef.h}
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
@c This is no longer provided by glibc, but rather by the compiler.
This expands to an integer constant expression that is the offset of the
[BZ #2510, BZ #2830, BZ #3137, BZ #3313, BZ #3426, BZ #3465, BZ #3480, BZ #3483, BZ #3493, BZ #3514, BZ #3515, BZ #3664, BZ #3673, BZ #3674] 2007-01-11 Jakub Jelinek <jakub@redhat.com> * sysdeps/i386/soft-fp/sfp-machine.h: Remove. * sysdeps/x86_64/soft-fp/sfp-machine.h: Likewise. 2007-01-10 Ulrich Drepper <drepper@redhat.com> * io/fts.c: Make sure fts_cur is always valid after return from fts_read. Patch by Miloslav Trmac <mitr@redhat.com>. 2006-10-27 Richard Sandiford <richard@codesourcery.com> * elf/elf.h (R_MIPS_GLOB_DAT): Define. (R_MIPS_NUM): Bump by 1. 2007-01-03 Jakub Jelinek <jakub@redhat.com> * posix/execvp.c: Include alloca.h. (allocate_scripts_argv): Renamed to... (scripts_argv): ... this. Don't allocate buffer here nor count arguments. (execvp): Use alloca if possible. * posix/Makefile: Add rules to build and run tst-vfork3 test. * posix/tst-vfork3.c: New test. * stdlib/Makefile (tst-strtod3-ENV): Define. 2007-01-02 Ulrich Drepper <drepper@redhat.com> * posix/getconf.c: Update copyright year. * nss/getent.c: Likewise. * iconv/iconvconfig.c: Likewise. * iconv/iconv_prog.c: Likewise. * elf/ldconfig.c: Likewise. * catgets/gencat.c: Likewise. * csu/version.c: Likewise. * elf/ldd.bash.in: Likewise. * elf/sprof.c (print_version): Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * nscd/nscd.c (print_version): Likewise. * debug/xtrace.sh: Likewise. * malloc/memusage.sh: Likewise. * malloc/mtrace.pl: Likewise. * debug/catchsegv.sh: Likewise. 2006-12-24 Ulrich Drepper <drepper@redhat.com> * malloc/malloc.c (sYSMALLOc): Remove some unnecessary alignment attempts. 2006-12-23 Ulrich Drepper <drepper@redhat.com> * posix/wordexp.c: Remove some unnecessary tests. 2006-12-20 SUGIOKA Toshinobu <sugioka@itonet.co.jp> * sysdeps/unix/sysv/linux/sh/bits/shm.h: New file. * nss/getXXbyYY_r.c: Include atomic.h. (INTERNAL (REENTRANT_NAME)): Write startp after start_fct, add atomic_write_barrier () in between. 2006-11-28 Jakub Jelinek <jakub@redhat.com> * elf/dl-support.c: Include dl-procinfo.h. * sysdeps/powerpc/dl-procinfo.h (PPC_PLATFORM_POWER4, PPC_PLATFORM_PPC970, PPC_PLATFORM_POWER5, PPC_PLATFORM_POWER5_PLUS, PPC_PLATFORM_POWER6, PPC_PLATFORM_CELL_BE, PPC_PLATFORM_POWER6X): Define. (_dl_string_platform): Use PPC_PLATFORM_* macros instead of hardcoded constants. * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_platform): Use PPC_PLATFORM_* macros for array designators. 2006-11-11 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/powerpc/dl-procinfo.c (_dl_powerpc_cap_flags): Add 3 new cap names to the beginning. (_dl_powerpc_platforms): Add "power6x". * sysdeps/powerpc/dl-procinfo.h (_DL_HWCAP_FIRST): Decrease. (HWCAP_IMPORTANT): Add PPC_FEATURE_HAS_DFP. (_DL_PLATFORMS_COUNT): Increase. (_dl_string_platform): Handle power6x case. * sysdeps/powerpc/sysdep.h (PPC_FEATURE_PA6T, PPC_FEATURE_HAS_DFP, PPC_FEATURE_POWER6_EXT): Define. (PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS): Correct Comment. [-2^31 .. 2^31) range. * sysdeps/unix/sysv/linux/bits/statvfs.h: Define ST_RELATIME. * sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags): Handle relatime mount option. 2006-12-13 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S: Include kernel-features.h. 2006-12-11 Ulrich Drepper <drepper@redhat.com> * stdlib/strtod_l.c (____STRTOF_INTERNAL): Parse thousand separators also if no non-zero digits found. * stdlib/Makefile (tests): Add tst-strtod3. [BZ #3664] * stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix test to recognize empty parsed strings. * stdlib/Makefile (tests): Add tst-strtod2. * stdlib/tst-strtod2.c: New file. [BZ #3673] * stdlib/strtod_l.c (____STRTOF_INTERNAL): Fix exp_limit computation. * stdlib/Makefile (tests): Add tst-atof2. * stdlib/tst-atof2.c: New file. [BZ #3674] * stdlib/strtod_l.c (____STRTOF_INTERNAL): Adjust exponent value correctly if removing trailing zero of hex-float. * stdlib/Makefile (tests): Add tst-atof1. * stdlib/tst-atof1.c: New file. * misc/mntent_r.c (__hasmntopt): Check p[optlen] even when p == rest. Start searching for next comma at p rather than rest. * misc/Makefile (tests): Add tst-mntent2. * misc/tst-mntent2.c: New test. 2006-12-08 Ulrich Drepper <drepper@redhat.com> * malloc/memusage.c: Handle realloc with new size of zero and non-NULL pointer correctly. (me): Really write first record twice. (struct entry): Make format bi-arch safe. (dest): Write out more realloc statistics. * malloc/memusagestat.c (struct entry): Make format bi-arch safe. 2006-12-05 Jakub Jelinek <jakub@redhat.com> * nis/nis_subr.c (nis_getnames): Revert last change. 2006-12-03 Kaz Kojima <kkojima@rr.iij4u.or.jp> * sysdeps/unix/sysv/linux/sh/sys/io.h: Removed. 2006-11-30 H.J. Lu <hongjiu.lu@intel.com> * sysdeps/i386/i686/memcmp.S: Use jump table as the base of jump table entries. 2006-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> * sysdeps/unix/sysv/linux/i386/clone.S: Provide CFI for the outermost `clone' function to ensure proper unwinding stop of gdb. * sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise. 2006-12-01 Ulrich Drepper <drepper@redhat.com> * nscd/nscd.init: Remove obsolete and commented-out -S option handling. 2006-11-23 Jakub Jelinek <jakub@redhat.com> [BZ #3514] * manual/string.texi (strncmp): Fix pastos from wcscmp description. [BZ #3515] * manual/string.texi (strtok): Remove duplicate paragraph. 2006-12-01 Jan Kratochvil <jan.kratochvil@redhat.com> * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Fix compatibility with libgcc not supporting `rflags' unwinding (register # >= 17). 2006-11-30 Jakub Jelinek <jakub@redhat.com> * sunrpc/svc_run.c (svc_run): Set my_pollfd to new_pollfd if realloc succeeded. 2006-11-29 Daniel Jacobowitz <dan@codesourcery.com> Jakub Jelinek <jakub@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> * sysdeps/unix/sysv/linux/x86_64/sigaction.c (restore_rt): Add correct unwind information. * sysdeps/unix/sysv/linux/x86_64/Makefile: Provide symbols for 'restore_rt' even in the 'signal' directory. * sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym: Extend the regs list. malloc crashed. Don't allocate memory unnecessarily in each loop. 2006-10-21 Jakub Jelinek <jakub@redhat.com> * resolv/mapv4v6addr.h (map_v4v6_address): Fix last change. 2006-11-20 Ulrich Drepper <drepper@redhat.com> * resolv/mapv4v6addr.h (map_v4v6_address): Optimize a bit. 2006-11-18 Bruno Haible <bruno@clisp.org> * sysdeps/unix/sysv/linux/i386/getgroups.c (__getgroups): Invoke __sysconf only after having tried to call getgroups32. 2006-11-19 Ulrich Drepper <drepper@redhat.com> * nss/nss_files/files-hosts.c (LINE_PARSER): Support IPv6-style addresses for IPv4 queries if they can be mapped. 2006-11-16 Jakub Jelinek <jakub@redhat.com> * sysdeps/x86_64/fpu/s_copysignf.S (__copysignf): Switch to .text. * sysdeps/x86_64/fpu/s_copysign.S (__copysign): Likewise. (signmask): Add .size directive. (othermask): Add .type directive. 2006-11-14 Ulrich Drepper <drepper@redhat.com> * po/nl.po: Update from translation team. * timezone/zdump.c: Redo fix for BZ #3137. 2006-11-14 Jakub Jelinek <jakub@redhat.com> * nss/nss_files/files-alias.c (get_next_alias): Set line back to first_unused after parsing :include: file. * timezone/africa: Update from tzdata2006o. * timezone/antarctica: Likewise. * timezone/asia: Likewise. * timezone/australasia: Likewise. * timezone/backward: Likewise. * timezone/europe: Likewise. * timezone/iso3166.tab: Likewise. * timezone/northamerica: Likewise. * timezone/southamerica: Likewise. * timezone/zone.tab: Likewise. * time/tzfile.c (__tzfile_read): Extend to handle new file format on machines with 64-bit time_t. * timezone/checktab.awk: Update from tzcode2006o. * timezone/ialloc.c: Likewise. * timezone/private.h: Likewise. * timezone/scheck.c: Likewise. * timezone/tzfile.h: Likewise. * timezone/tzselect.ksh: Likewise. * timezone/zdump.c: Likewise. * timezone/zic.c: Likewise. [BZ #3483] * elf/ldconfig.c (main): Call setlocale and textdomain. Patch mostly by Benno Schulenberg <bensberg@justemail.net>. [BZ #3480] * manual/argp.texi: Fix typos. * manual/charset.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/lang.texi: Likewise. * manual/maint.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/signal.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/time.texi: Likewise. Patch by Ralf Wildenhues <Ralf.Wildenhues@gmx.de>. [BZ #3465] * sunrpc/clnt_raw.c: Minimal message improvements. * sunrpc/pm_getmaps.c: Likewise. * nis/nss_nisplus/nisplus-publickey.c: Likewise. * nis/nis_print_group_entry.c: Likewise. * locale/programs/repertoire.c: Likewise. * locale/programs/charmap.c: Likewise. * malloc/memusage.sh: Likewise. * elf/dl-deps.c: Likewise. * locale/programs/ld-collate.c: Likewise. * libio/vswprintf.c: Likewise. * malloc/memusagestat.c: Likewise. * sunrpc/auth_unix.c: Likewise. * sunrpc/rpc_main.c: Likewise. * nscd/cache.c: Likewise. * locale/programs/repertoire.c: Unify output messages. * locale/programs/charmap.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-time.c: Likewise. * elf/ldconfig.c: Likewise. * nscd/selinux.c: Likewise. * elf/cache.c: Likewise. Patch mostly by Benno Schulenberg <bensberg@justemail.net>. 2006-11-10 Jakub Jelinek <jakub@redhat.com> * string/strxfrm_l.c (STRXFRM): Fix trailing \1 optimization if N is one bigger than return value. * string/tst-strxfrm2.c (do_test): Also test strxfrm with l1 + 1 and l1 last arguments, if buf is defined, verify the return value equals to strlen (buf) and verify no byte beyond passed length is modified. 2006-11-10 Ulrich Drepper <drepper@redhat.com> * po/sv.po: Update from translation team. * sysdeps/gnu/siglist.c (__old_sys_siglist, __old_sys_sigabbrev): Use __new_sys_siglist instead of _sys_siglist_internal as second macro argument. (_old_sys_siglist): Use declare_symbol_alias macro instead of strong_alias. 2006-11-09 Ulrich Drepper <drepper@redhat.com> [BZ #3493] * posix/unistd.h (sysconf): Remove const attribute. * sysdeps/posix/getaddrinfo.c (getaddrinfo): Fix test for temporary or deprecated addresses. Patch by Sridhar Samudrala <sri@us.ibm.com>. * string/Makefile (tests): Add tst-strxfrm2. * string/tst-strxfrm2.c: New file. 2006-10-09 Jakub Jelinek <jakub@redhat.com> * elf/dl-debug.c (_dl_debug_initialize): Check r->r_map for 0 rather than r->r_brk. * string/strxfrm_l.c (STRXFRM): Do the trailing \1 removal optimization even if needed > n. 2006-11-07 Jakub Jelinek <jakub@redhat.com> * include/libc-symbols.h (declare_symbol): Rename to... (declare_symbol_alias): ... this. Add ORIGINAL argument, imply strong_alias (ORIGINAL, SYMBOL) in asm to make sure it preceedes .size directive. * sysdeps/gnu/errlist-compat.awk: Adjust for declare_symbol_alias changes. * sysdeps/gnu/siglist.c: Likewise. 2006-11-03 Steven Munroe <sjmunroe@us.ibm.com> * sysdeps/powerpc/fpu/bits/mathinline.h [__LIBC_INTERNAL_MATH_INLINES]: Moved to ... * sysdeps/powerpc/fpu/math_private.h: ...here. New file. 2006-11-05 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/i386/sysconf.c (intel_check_word): Update handling of cache descriptor 0x49 for new models. * sysdeps/unix/sysv/linux/x86_64/sysconf.c (intel_check_word): Likewise. 2006-11-02 Ulrich Drepper <drepper@redhat.com> * configure.in: Work around ld --help change and avoid -z relro test completely if the architecture doesn't care about security. 2006-11-01 Ulrich Drepper <drepper@redhat.com> * po/sv.po: Update from translation team. 2006-10-31 Ulrich Drepper <drepper@redhat.com> * stdlib/atexit.c (atexit): Don't mark as hidden when used to generate compatibility version. 2006-10-29 Ulrich Drepper <drepper@redhat.com> * configure.in: Relax -z relro requirement a bit. * po/sv.po: Update from translation team. 2006-10-29 Jakub Jelinek <jakub@redhat.com> * elf/dl-sym.c (do_sym): Use RTLD_SINGLE_THREAD_P. * elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Likewise. * elf/dl-close.c (_dl_close_worker): Likewise. * elf/dl-open.c (_dl_open_worker): Likewise. * sysdeps/generic/sysdep-cancel.h (RTLD_SINGLE_THREAD_P): Define. * configure.in: Require assembler support for visibility, compiler support for visibility and aliases, linker support for various -z options. * Makeconfig: Remove conditional code which now is unnecessary. * config.h.in: Likewise. * config.make.in: Likewise. * dlfcn/Makefile: Likewise. * elf/Makefile: Likewise. * elf/dl-load.c: Likewise. * elf/rtld.c: Likewise. * include/libc-symbols.h: Likewise. * include/stdio.h: Likewise. * io/Makefile: Likewise. * io/fstat.c: Likewise. * io/fstat64.c: Likewise. * io/fstatat.c: Likewise. * io/fstatat64.c: Likewise. * io/lstat.c: Likewise. * io/lstat64.c: Likewise. * io/mknod.c: Likewise. * io/mknodat.c: Likewise. * io/stat.c: Likewise. * io/stat64.c: Likewise. * libio/stdio.c: Likewise. * nscd/Makefile: Likewise. * stdlib/Makefile: Likewise. * stdlib/atexit.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * sysdeps/i386/sysdep.h: Likewise. * sysdeps/i386/i686/memcmp.S: Likewise. * sysdeps/powerpc/powerpc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/x86_64/sigaction.c: Likewise. * Makerules: USE_TLS support is now default. * tls.make.c: Likewise. * csu/Versions: Likewise. * csu/libc-start.c: Likewise. * csu/libc-tls.c: Likewise. * csu/version.c: Likewise. * dlfcn/dlinfo.c: Likewise. * elf/dl-addr.c: Likewise. * elf/dl-cache.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-iteratephdr.c: Likewise. * elf/dl-load.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-object.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-reloc.c: Likewise. * elf/dl-support.c: Likewise. * elf/dl-sym.c: Likewise. * elf/dl-sysdep.c: Likewise. * elf/dl-tls.c: Likewise. * elf/ldconfig.c: Likewise. * elf/rtld.c: Likewise. * elf/tst-tls-dlinfo.c: Likewise. * elf/tst-tls1.c: Likewise. * elf/tst-tls10.h: Likewise. * elf/tst-tls14.c: Likewise. * elf/tst-tls2.c: Likewise. * elf/tst-tls3.c: Likewise. * elf/tst-tls4.c: Likewise. * elf/tst-tls5.c: Likewise. * elf/tst-tls6.c: Likewise. * elf/tst-tls7.c: Likewise. * elf/tst-tls8.c: Likewise. * elf/tst-tls9.c: Likewise. * elf/tst-tlsmod1.c: Likewise. * elf/tst-tlsmod13.c: Likewise. * elf/tst-tlsmod13a.c: Likewise. * elf/tst-tlsmod14a.c: Likewise. * elf/tst-tlsmod2.c: Likewise. * elf/tst-tlsmod3.c: Likewise. * elf/tst-tlsmod4.c: Likewise. * elf/tst-tlsmod5.c: Likewise. * elf/tst-tlsmod6.c: Likewise. * include/errno.h: Likewise. * include/link.h: Likewise. * include/tls.h: Likewise. * locale/global-locale.c: Likewise. * locale/localeinfo.h: Likewise. * malloc/arena.c: Likewise. * malloc/hooks.c: Likewise. * malloc/malloc.c: Likewise. * resolv/Versions: Likewise. * sysdeps/alpha/dl-machine.h: Likewise. * sysdeps/alpha/libc-tls.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/generic/tls.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * sysdeps/ia64/dl-machine.h: Likewise. * sysdeps/ia64/libc-tls.c: Likewise. * sysdeps/mach/hurd/fork.c: Likewise. * sysdeps/mach/hurd/i386/tls.h: Likewise. * sysdeps/powerpc/powerpc32/dl-machine.c: Likwise. * sysdeps/powerpc/powerpc32/dl-machine.h: Likewise. * sysdeps/powerpc/powerpc64/dl-machine.h: Likewise. * sysdeps/s390/libc-tls.c: Likewise. * sysdeps/s390/s390-32/dl-machine.h: Likewise. * sysdeps/s390/s390-64/dl-machine.h: Likewise. * sysdeps/sh/dl-machine.h: Likewise. * sysdeps/sparc/sparc32/dl-machine.h: Likewise. * sysdeps/sparc/sparc64/dl-machine.h: Likewise. * sysdeps/x86_64/dl-machine.h: Likewise. [BZ #3426] * stdlib/stdlib.h: Adjust comment for canonicalize_file_name to reality. 2006-10-27 Jakub Jelinek <jakub@redhat.com> * elf/dl-lookup.c (_dl_debug_bindings): Remove unused symbol_scope argument. (_dl_lookup_symbol_x): Adjust caller. * sysdeps/generic/ldsodefs.h (struct link_namespaces): Remove _ns_global_scope. * elf/rtld.c (dl_main): Don't initialize _ns_global_scope. * elf/dl-libc.c: Revert l_scope name changes. * elf/dl-load.c: Likewise. * elf/dl-object.c: Likewise. * elf/rtld.c: Likewise. * elf/dl-close.c (_dl_close): Likewise. * elf/dl-open.c (dl_open_worker): Likewise. If not SINGLE_THREAD_P, always use __rtld_mrlock_{change,done}. Always free old scope list here if not l_scope_mem. * elf/dl-runtime.c (_dl_fixup, _dl_profile_fixup): Revert l_scope name change. Never free scope list here. Just __rtld_mrlock_lock before the lookup and __rtld_mrlock_unlock it after the lookup. * elf/dl-sym.c: Likewise. * include/link.h (struct r_scoperec): Remove. (struct link_map): Replace l_scoperec with l_scope, l_scoperec_mem with l_scope_mem and l_scoperec_lock with l_scope_lock. 2006-10-25 Ulrich Drepper <drepper@redhat.com> * sysdeps/gnu/netinet/tcp.h: Define TCP_CONGESTION. 2006-10-18 Ulrich Drepper <drepper@redhat.com> * configure.in: Disable building profile libraries by default. 2006-10-18 Ulrich Drepper <drepper@redhat.com> * elf/dl-lookup.c (_dl_lookup_symbol_x): Add warning to _dl_lookup_symbol_x code. 2006-10-17 Jakub Jelinek <jakub@redhat.com> * elf/dl-runtime.c: Include sysdep-cancel.h. (_dl_fixup, _dl_profile_fixup): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. * elf/dl-sym.c: Include sysdep-cancel.h. (do_sym): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. * elf/dl-close.c: Include sysdep-cancel.h. (_dl_close): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. * elf/dl-open.c: Include sysdep-cancel.h. (dl_open_worker): Use __rtld_mrlock_* and scoperec->nusers only if !SINGLE_THREAD_P. Use atomic_* instead of catomic_* macros. 2006-10-17 Jakub Jelinek <jakub@redhat.com> [BZ #3313] * malloc/malloc.c (malloc_consolidate): Set maxfb to address of last fastbin rather than end of fastbin array. 2006-10-18 Ulrich Drepper <drepper@redhat.com> * sysdeps/i386/i486/bits/atomic.h (catomic_decrement): Use correct body macro. * sysdeps/x86_64/bits/atomic.h (__arch_c_compare_and_exchange_val_64_acq): Add missing casts. (catomic_decrement): Use correct body macro. 2006-10-17 Jakub Jelinek <jakub@redhat.com> * include/atomic.h: Add a unique prefix to all local variables in macros. * csu/tst-atomic.c (do_test): Test also catomic_* macros. 2006-10-14 Ulrich Drepper <drepper@redhat.com> * resolv/arpa/nameser.h: Document that ns_t_a6 is deprecated. [BZ #3313] * malloc/malloc.c (malloc_consolidate): Don't use get_fast_max to determine highest fast bin to consolidate, always look into all of them. (do_check_malloc_state): Only require for empty bins for large sizes in main arena. * libio/stdio.h: Add more __wur attributes. 2006-11-12 Andreas Jaeger <aj@suse.de> [BZ #2510] * manual/search.texi (Hash Search Function): Clarify. (Array Search Function): Clarify. 2006-11-12 Joseph Myers <joseph@codesourcery.com> [BZ #2830] * math/atest-exp.c (main): Cast hex value to mp_limb_t before shifting. * math/atest-exp2.c (read_mpn_hex): Likewise. * math/atest-sincos.c (main): Likewise. * sysdeps/unix/sysv/linux/syscalls.list: Add epoll_pwait. * sysdeps/unix/sysv/linux/sys/epoll.h: Declare epoll_pwait. * sysdeps/unix/sysv/linux/Versions (libc): Add epoll_pwait for version GLIBC_2.6. * Versions.def: Add GLIBC_2.6 for libc. * sysdeps/i386/i486/bits/atomic.h: Add catomic_* support. 2006-10-11 Jakub Jelinek <jakub@redhat.com> * malloc/malloc.c (_int_malloc): Remove unused any_larger variable. * nis/nis_defaults.c (__nis_default_access): Don't call getenv twice. * nis/nis_subr.c (nis_getnames): Use __secure_getenv instead of getenv. * sysdeps/generic/unsecvars.h: Add NIS_PATH. 2006-10-11 Ulrich Drepper <drepper@redhat.com> * include/atomic.c: Define catomic_* operations. * sysdeps/x86_64/bits/atomic.h: Likewise. Fix a few minor problems. * stdlib/cxa_finalize.c: Use catomic_* operations instead of atomic_*. * malloc/memusage.c: Likewise. * gmon/mcount.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-profile.c: Likewise. * elf/dl-sym.c: Likewise. * elf/dl-runtime.c: Likewise. * elf/dl-fptr.c: Likewise. * resolv/res_libc.c: Likewise. 2006-10-10 Roland McGrath <roland@frob.com> * sysdeps/mach/hurd/utimes.c: Use a union to avoid an improper cast. * sysdeps/mach/hurd/futimes.c: Likewise. * sysdeps/mach/hurd/lutimes.c: Likewise. 2006-10-09 Ulrich Drepper <drepper@redhat.com> Jakub Jelinek <jakub@redhat.com> Implement reference counting of scope records. * elf/dl-close.c (_dl_close): Remove all scopes from removed objects from the list in objects which remain. Always allocate new scope record. * elf/dl-open.c (dl_open_worker): When growing array for scopes, don't resize, allocate a new one. * elf/dl-runtime.c: Update reference counters before using a scope array. * elf/dl-sym.c: Likewise. * elf/dl-libc.c: Adjust for l_scope name change. * elf/dl-load.c: Likewise. * elf/dl-object.c: Likewise. * elf/rtld.c: Likewise. * include/link.h: Include <rtld-lowlevel.h>. Define struct r_scoperec. Replace r_scope with pointer to r_scoperec structure. Add l_scoperec_lock. * sysdeps/generic/ldsodefs.h: Include <rtld-lowlevel.h>. * sysdeps/generic/rtld-lowlevel.h: New file. * include/atomic.h: Rename atomic_and to atomic_and_val and atomic_or to atomic_or_val. Define new macros atomic_and and atomic_or which do not return values. * sysdeps/x86_64/bits/atomic.h: Define atomic_and and atomic_or. Various cleanups. * sysdeps/i386/i486/bits/atomic.h: Likewise. * po/sv.po: Update from translation team. 2006-10-07 Ulrich Drepper <drepper@redhat.com> * Versions.def: Add GLIBC_2.6 to libpthread. * include/shlib-compat.h (SHLIB_COMPAT): Expand parameters before use. (versioned_symbol): Likewise. (compat_symbol): Likewise. * po/tr.po: Update from translation team. * nis/Banner: Removed. It's been integral part forever and the author info is incomplete anyway. * libio/Banner: Likewise. 2006-10-06 Ulrich Drepper <drepper@redhat.com> * version.h (VERSION): Bump to 2.5.90 for new development tree.
2007-01-11 22:51:07 +01:00
structure member named @var{member} in the structure type @var{type}.
1995-02-18 02:27:10 +01:00
For example, @code{offsetof (struct s, elem)} is the offset, in bytes,
of the member @code{elem} in a @code{struct s}.
This macro won't work if @var{member} is a bit field; you get an error
from the C compiler in that case.
@end deftypefn