[PATCH] adjust RPC function declarations to match Sun's (BZ 26686)

Martin Sebor msebor@gmail.com
Mon Oct 5 21:17:11 GMT 2020


Building Glibc with the latest GCC 11 shows a number of instances
of the new -Warray-parameter.  The warning is designed to encourage
consistency in the forms of array arguments in redeclarations of
the same function (and, ultimately, to enable the detection of out
of bounds accesses via such arguments).

To avoid the subset of these warnings for the RPC APIs, the attached
patch changes the declarations of these functions to match both their
definitions and the Oracle RPC documentation.

Besides avoiding the -Warray-parameter warnings the effect of this
change is for GCC to issue warnings when either the functions are
passed an array with fewer than MAXNETNAMELEN + 1 elements, or when
the functions themselves access elements outside the array bounds.

I tested the patch by building Glibc with GCC and confirming
the warnings are gone, and by running the tests and confirming no
new failures in the test suite.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glibc-26686.diff
Type: text/x-patch
Size: 1048 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20201005/588b33b3/attachment-0001.bin>


More information about the Libc-alpha mailing list