Permalink
Browse files

Lint: more constant expressions

  • Loading branch information...
krader1961 committed Sep 12, 2018
1 parent e554582 commit 64c5e03a86825cfa445922e7fd9c5a99bbc4ab79
Showing with 19 additions and 1 deletion.
  1. +1 −0 bin/lint
  2. +1 −0 config_ast.h.in
  3. +1 −0 meson.build
  4. +1 −1 src/cmd/ksh93/include/edit.h
  5. +15 −0 src/lib/libast/include/ast.h
View
@@ -212,6 +212,7 @@ then
fi
oclint -p "${PWD}" -enable-clang-static-analyzer ${enable_global_analysis} \
-extra-arg="-D_OCLINT_" \
-extra-arg="-isystem" -extra-arg="${system_hdrs}" "${c_files[@]}" 2>&1 |
sed -e 's,^\.\./,,'
fi
View
@@ -45,6 +45,7 @@
#mesondefine _ast_sizeof_pointer
#mesondefine _ast_sizeof_size_t
#mesondefine _ast_sizeof_int32_t
#mesondefine _ast_sizeof_wchar_t
#mesondefine _cmd_newgrp
#mesondefine _cmd_nfsd
#mesondefine _cmd_tput
View
@@ -230,6 +230,7 @@ feature_data.set('_ast_sizeof_long', long_size)
feature_data.set('_ast_sizeof_size_t', size_t_size)
feature_data.set('_ast_sizeof_off_t', off_t_size)
feature_data.set('_ast_sizeof_pointer', ptr_size)
feature_data.set('_ast_sizeof_wchar_t', wchar_t_size)
feature_data.set('_ptr_bits', ptr_size * 8)
subdir('features')
@@ -33,7 +33,7 @@
#define LOOKAHEAD 80
typedef wchar_t genchar;
#define CHARSIZE (sizeof(wchar_t) <= 2 ? 3 : sizeof(wchar_t))
#define CHARSIZE _ast_sizeof_wchar_t
#define TABSIZE 8
#define PRSIZE 256
@@ -313,4 +313,19 @@ extern unsigned long plugin_version(void);
#define CC_sub 0032 // SUB character
#define CC_vt 0013 // VT character
// If running under the oclint tool try to suppress some platform specific warnings.
// For example, on macOS many commonly used functions are defined in terms of macros
// that contain expressions which always evalute true or false.
#if _OCLINT_
#undef strcat
#undef strcpy
#undef strncpy
#undef strlcat
#undef strlcpy
#undef memcpy
#undef memmove
#endif
#endif // _AST_H

0 comments on commit 64c5e03

Please sign in to comment.