Skip to content

Commit

Permalink
suppress clang warnings
Browse files Browse the repository at this point in the history
The warnings need to be suppressed only when compiling preprocessed
code during 3m compilation (because clang doesn't complain about
the relevant patterns when it knows that macros produced them).
  • Loading branch information
mflatt committed Dec 30, 2013
1 parent d336382 commit 56483c8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
6 changes: 6 additions & 0 deletions racket/src/racket/src/eval.c
Expand Up @@ -172,6 +172,12 @@
# define INIT_JIT_ON 0
#endif

#ifdef __GNUC__
# ifdef MZ_PRECISE_GC
# pragma clang diagnostic ignored "-Wself-assign"
# endif
#endif

/* globals */
SHARED_OK int scheme_startup_use_jit = INIT_JIT_ON;
void scheme_set_startup_use_jit(int v) { scheme_startup_use_jit = v; }
Expand Down
15 changes: 12 additions & 3 deletions racket/src/racket/src/file.c
Expand Up @@ -157,6 +157,12 @@ static int check_dos_slashslash_qm(const char *next, int len, int *drive_end,

#define is_drive_letter(c) (((unsigned char)c < 128) && isalpha((unsigned char)c))

#ifdef __GNUC__
# ifdef MZ_PRECISE_GC
# pragma clang diagnostic ignored "-Wtautological-compare"
# endif
#endif

/* local */
static Scheme_Object *path_p(int argc, Scheme_Object **argv);
static Scheme_Object *general_path_p(int argc, Scheme_Object **argv);
Expand Down Expand Up @@ -6311,13 +6317,16 @@ find_system_path(int argc, Scheme_Object **argv)

ends_in_slash = (SCHEME_PATH_VAL(home))[SCHEME_PATH_LEN(home) - 1] == '/';

/* cast here avoids a clang warning: */
# define mz_STR_OFFSET(s, d) ((const char *)s + d)

if (which == id_init_file)
return append_path(home, scheme_make_path("/.racketrc" + ends_in_slash));
return append_path(home, scheme_make_path(mz_STR_OFFSET("/.racketrc", ends_in_slash)));
if (which == id_pref_file) {
#if defined(OS_X) && !defined(XONX)
return append_path(home, scheme_make_path("/org.racket-lang.prefs.rktd" + ends_in_slash));
return append_path(home, scheme_make_path(mz_STR_OFFSET("/org.racket-lang.prefs.rktd", ends_in_slash)));
#else
return append_path(home, scheme_make_path("/racket-prefs.rktd" + ends_in_slash));
return append_path(home, scheme_make_path(mz_STR_OFFSET("/racket-prefs.rktd", ends_in_slash)));
#endif
}
}
Expand Down
5 changes: 5 additions & 0 deletions racket/src/racket/src/jit.h
Expand Up @@ -31,6 +31,11 @@

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Waddress"
# ifdef MZ_PRECISE_GC
# pragma clang diagnostic ignored "-Wtautological-compare"
# pragma clang diagnostic ignored "-Wself-assign"
# pragma clang diagnostic ignored "-Wconstant-logical-operand"
# endif
#endif

/* Separate JIT_PRECISE_GC lets us test some 3m support in non-3m mode: */
Expand Down
6 changes: 6 additions & 0 deletions racket/src/racket/src/read.c
Expand Up @@ -47,6 +47,12 @@
# include <malloc.h>
#endif

#ifdef __GNUC__
# ifdef MZ_PRECISE_GC
# pragma clang diagnostic ignored "-Wself-assign"
# endif
#endif

#define MAX_QUICK_SYMBOL_SIZE 64

/* Init options for embedding: */
Expand Down

0 comments on commit 56483c8

Please sign in to comment.