diff --git a/lib/common/compiler.h b/lib/common/compiler.h index 9e2a8fe7..cae0061a 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -79,6 +79,13 @@ # define UNUSED_ATTR #endif +/* CONST_ARGC tells the compiler correct const argc specificator for -Wmain. */ +#if !defined(__LCC__) +# define CONST_ARGC const +#else +# define CONST_ARGC +#endif + /* force no inlining */ #ifdef _MSC_VER # define FORCE_NOINLINE static __declspec(noinline) @@ -151,7 +158,7 @@ /* vectorization * older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */ -#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) +#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && !defined(__LCC__) # if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5) # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) # else diff --git a/programs/zstdcli.c b/programs/zstdcli.c index e496852f..845610dc 100644 --- a/programs/zstdcli.c +++ b/programs/zstdcli.c @@ -741,7 +741,7 @@ typedef enum { zom_compress, zom_decompress, zom_test, zom_bench, zom_train, zom # define MAXCLEVEL ZSTD_maxCLevel() #endif -int main(int const argCount, const char* argv[]) +int main(int CONST_ARGC argCount, const char* argv[]) { int argNb, followLinks = 0,