case PT_LOAD:
/* A load command tells us to map in part of the file.
We record the load commands and process them all later. */
- if ((ph->p_align & (GL(dl_pagesize) - 1)) != 0)
+ if (__builtin_expect ((ph->p_align & (GL(dl_pagesize) - 1)) != 0,
+ 0))
{
errstring = N_("ELF load command alignment not page-aligned");
goto call_lose;
}
- if (((ph->p_vaddr - ph->p_offset) & (ph->p_align - 1)) != 0)
+ if (__builtin_expect (((ph->p_vaddr - ph->p_offset)
+ & (ph->p_align - 1)) != 0, 0))
{
errstring
= N_("ELF load command address/offset not properly aligned");
l->l_map_start = (ElfW(Addr)) __mmap ((void *) mappref, maplength,
c->prot, MAP_COPY | MAP_FILE,
fd, c->mapoff);
- if ((void *) l->l_map_start == MAP_FAILED)
+ if (__builtin_expect ((void *) l->l_map_start == MAP_FAILED, 0))
{
map_error:
errstring = N_("failed to map segment from shared object");
if ((c->prot & PROT_WRITE) == 0)
{
/* Dag nab it. */
- if (__mprotect ((caddr_t) (zero & ~(GL(dl_pagesize) - 1)),
- GL(dl_pagesize), c->prot|PROT_WRITE) < 0)
+ if (__builtin_expect (__mprotect ((caddr_t)
+ (zero
+ & ~(GL(dl_pagesize)
+ - 1)),
+ GL(dl_pagesize),
+ c->prot|PROT_WRITE) < 0,
+ 0))
{
errstring = N_("cannot change memory protections");
goto call_lose_errno;
mapat = __mmap ((caddr_t) zeropage, zeroend - zeropage,
c->prot, MAP_ANON|MAP_PRIVATE|MAP_FIXED,
ANONFD, 0);
- if (mapat == MAP_FAILED)
+ if (__builtin_expect (mapat == MAP_FAILED, 0))
{
errstring = N_("cannot map zero-fill pages");
goto call_lose_errno;
if (l->l_ld == 0)
{
- if (type == ET_DYN)
+ if (__builtin_expect (type == ET_DYN, 0))
{
errstring = N_("object file has no dynamic section");
goto call_lose;
fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
&realname, &fb);
- /* Add another newline when we a tracing the library loading. */
+ /* Add another newline when we are tracing the library loading. */
if (__builtin_expect (GL(dl_debug_mask) & DL_DEBUG_LIBS, 0))
INTUSE(_dl_debug_printf) ("\n");
}
@deftypefn Macro void assert_perror (int @var{errnum})
Similar to @code{assert}, but verifies that @var{errnum} is zero.
-If @code{NDEBUG} is defined, @code{assert_perror} tests the value of
+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:
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
+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.
@xref{Error Messages}, for information on printing error messages for
@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
+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.
@strong{Portability note:} For some C compilers, the last required
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
+(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.)
@end enumerate
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
+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.
One kind of calling convention is to pass the number of optional
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
+assign the value of one variable of type @code{va_list} to another variable
of the same type.
@comment stdarg.h
@end deftypefn
If you want to use @code{__va_copy} you should always be prepared for the
-possibility that this macro will not be available. On architectures where a
+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:
@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
+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.
@cindex normalized floating point number