Eliminate -Wunknown-pragmas and -Wsign-compare warnings on GCC

This commit is contained in:
darealshinji 2020-02-09 11:39:50 +01:00 committed by Albrecht Schlosser
parent 707b81b626
commit 71dc3269cd
2 changed files with 5 additions and 1 deletions

View File

@ -519,7 +519,7 @@ static char *text_file_preview(const char *fname) {
int len = fread(text, 1, 4010, in);
fclose(in);
text[len] = 0;
if (strlen(text) < len) text[0] = 0; // presence of null byte in file --> not text
if ((int)strlen(text) < len) text[0] = 0; // presence of null byte in file --> not text
char *p = text;
int count = 0;
const char *end = text + strlen(text);

View File

@ -1268,8 +1268,10 @@ static long getIncrData(uchar* &data, const XSelectionEvent& selevent, long lowe
Note: '#pragma GCC diagnostic push' needs at least GCC 4.6.
*/
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))
#pragma GCC diagnostic push
@ -1284,7 +1286,9 @@ static KeySym fl_KeycodeToKeysym(Display *d, KeyCode k, unsigned i) {
#pragma GCC diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#if USE_XRANDR
static void react_to_screen_reconfiguration() {