mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 01:38:16 +00:00
MAKE: ask gnulikes to warn and be pedantic + fixes
It seems clang 3.4 thinks the codebase is in fantastic shape and gcc 4.9.0 has only minor niggles, which I fixed: - fix uninitialized member warning: In DEBUG mode the expr member doesn't get properly initialized to NULL. - fix warnings about directive inside of macro's: On some platforms/compilers, sprintf is a macro. Putting macro directives inside of a macro is unportable and gcc 4.9 warns about that. - fix signed vs. unsigned comparison warning: The in-memory table will luckily not even come close to the limits imposed by ssize_t. If it ever reaches that, we've got bigger problems.
This commit is contained in:

committed by
Thiago de Arruda

parent
6eece5895e
commit
3f29a02166
21
src/fileio.c
21
src/fileio.c
@@ -4209,15 +4209,14 @@ void msg_add_lines(int insert_space, long lnum, off_t nchars)
|
||||
|
||||
if (insert_space)
|
||||
*p++ = ' ';
|
||||
if (shortmess(SHM_LINES))
|
||||
sprintf((char *)p,
|
||||
if (shortmess(SHM_LINES)) {
|
||||
#ifdef LONG_LONG_OFF_T
|
||||
"%ldL, %lldC", lnum, nchars
|
||||
sprintf((char *)p, "%ldL, %lldC", lnum, nchars);
|
||||
#else
|
||||
/* Explicit typecast avoids warning on Mac OS X 10.6 */
|
||||
"%ldL, %ldC", lnum, (long)nchars
|
||||
/* Explicit typecast avoids warning on Mac OS X 10.6 */
|
||||
sprintf((char *)p, "%ldL, %ldC", lnum, (long)nchars);
|
||||
#endif
|
||||
);
|
||||
}
|
||||
else {
|
||||
if (lnum == 1)
|
||||
STRCPY(p, _("1 line, "));
|
||||
@@ -4226,15 +4225,13 @@ void msg_add_lines(int insert_space, long lnum, off_t nchars)
|
||||
p += STRLEN(p);
|
||||
if (nchars == 1)
|
||||
STRCPY(p, _("1 character"));
|
||||
else
|
||||
sprintf((char *)p,
|
||||
else {
|
||||
#ifdef LONG_LONG_OFF_T
|
||||
_("%lld characters"), nchars
|
||||
sprintf((char *)p, _("%lld characters"), nchars);
|
||||
#else
|
||||
/* Explicit typecast avoids warning on Mac OS X 10.6 */
|
||||
_("%ld characters"), (long)nchars
|
||||
sprintf((char *)p, _("%ld characters"), (long)nchars);
|
||||
#endif
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user