libelf/testsuite: Turn off a Coverity Scan warning.
The repeated assignments that are being flagged by Coverity
are to be expected, given the way that the test functions
are being generated.
libelf/testsuite: improve the readability of macro-expanded code.
This change removes superfluous semicolons and whitespace, but
does not otherwise change the generated text.
libelf: Reject negative file descriptor values earlier in elf_begin().
This change allows us to avoid issuing system calls that
are guaranteed to fail.
Detected by: Coverity Scan
libelf/testsuite: handle older implementations of mkstemp().
Explicitly set the process file mode creation mask before using
mkstemp() to create temporary files.
This change should improve security on systems with older
implementations of mkstemp() that do not create temporary files
with 'group' and 'other' access turned off by default.
Detected by: Coverity Scan
libelf/testsuite: handle unsigned enumeration specifiers better.
Per the C standard (section 6.7.2.2 "Enumeration specifiers"),
it is implementation-defined whether the underlying type of an
enumeration is signed or unsigned. Enumeration constants
themselves are required to be of type 'int' (section 6.4.4.3
"Enumeration constants").
In compilation environments that use an unsigned enumeration
types, an expression like "Elf_Cmd c = ELF_C_NULL - 1" could
end up assigning a large positive unsigned value to "c", which
is not what is desired.
Detected by: Coverity Scan
tests/tet/libelf: Avoid a build-time filename collision.
This change prevents make(1) from overwriting a source file with
the content generated by an application of the ".m4.c" suffix
transformation rule.