Eliminate some GCC warnings

* src/doprnt.c (exprintf, evxprintf):
* src/lisp.h (exprintf, evxprintf): Don't use a pointer-to-const type
for the `nonheapbuf` argument: although it is never dereferenced, GCC
will warn when passing a pointer to uninitialised memory otherwise.
* src/fns.c (sort_vector_copy, realize_face, realize_gui_face)
(realize_tty_face): Use the same signatures in the prototypes as in
the actual function definitions.
This commit is contained in:
Mattias Engdegård 2021-06-16 18:05:41 +02:00
parent 1f4e919cb2
commit 7c22aa36cd
4 changed files with 13 additions and 9 deletions

View file

@ -563,7 +563,7 @@ esprintf (char *buf, char const *format, ...)
BUFSIZE_MAX. */
ptrdiff_t
exprintf (char **buf, ptrdiff_t *bufsize,
char const *nonheapbuf, ptrdiff_t bufsize_max,
char *nonheapbuf, ptrdiff_t bufsize_max,
char const *format, ...)
{
ptrdiff_t nbytes;
@ -579,7 +579,7 @@ exprintf (char **buf, ptrdiff_t *bufsize,
/* Act like exprintf, except take a va_list. */
ptrdiff_t
evxprintf (char **buf, ptrdiff_t *bufsize,
char const *nonheapbuf, ptrdiff_t bufsize_max,
char *nonheapbuf, ptrdiff_t bufsize_max,
char const *format, va_list ap)
{
for (;;)

View file

@ -39,8 +39,9 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "puresize.h"
#include "gnutls.h"
static void sort_vector_copy (Lisp_Object, ptrdiff_t,
Lisp_Object *restrict, Lisp_Object *restrict);
static void sort_vector_copy (Lisp_Object pred, ptrdiff_t len,
Lisp_Object src[restrict VLA_ELEMS (len)],
Lisp_Object dest[restrict VLA_ELEMS (len)]);
enum equal_kind { EQUAL_NO_QUIT, EQUAL_PLAIN, EQUAL_INCLUDING_PROPERTIES };
static bool internal_equal (Lisp_Object, Lisp_Object,
enum equal_kind, int, Lisp_Object);

View file

@ -4064,10 +4064,10 @@ extern ptrdiff_t doprnt (char *, ptrdiff_t, const char *, const char *,
va_list);
extern ptrdiff_t esprintf (char *, char const *, ...)
ATTRIBUTE_FORMAT_PRINTF (2, 3);
extern ptrdiff_t exprintf (char **, ptrdiff_t *, char const *, ptrdiff_t,
extern ptrdiff_t exprintf (char **, ptrdiff_t *, char *, ptrdiff_t,
char const *, ...)
ATTRIBUTE_FORMAT_PRINTF (5, 6);
extern ptrdiff_t evxprintf (char **, ptrdiff_t *, char const *, ptrdiff_t,
extern ptrdiff_t evxprintf (char **, ptrdiff_t *, char *, ptrdiff_t,
char const *, va_list)
ATTRIBUTE_FORMAT_PRINTF (5, 0);

View file

@ -353,10 +353,13 @@ static bool menu_face_changed_default;
struct named_merge_point;
static struct face *realize_face (struct face_cache *, Lisp_Object *,
static struct face *realize_face (struct face_cache *,
Lisp_Object [LFACE_VECTOR_SIZE],
int);
static struct face *realize_gui_face (struct face_cache *, Lisp_Object *);
static struct face *realize_tty_face (struct face_cache *, Lisp_Object *);
static struct face *realize_gui_face (struct face_cache *,
Lisp_Object [LFACE_VECTOR_SIZE]);
static struct face *realize_tty_face (struct face_cache *,
Lisp_Object [LFACE_VECTOR_SIZE]);
static bool realize_basic_faces (struct frame *);
static bool realize_default_face (struct frame *);
static void realize_named_face (struct frame *, Lisp_Object, int);