THRIFT-1276 Add thrift compiler option to suppress warnings about
Patch: Dave Watson
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1159593 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/main.cc b/compiler/cpp/src/main.cc
index da86d0d..892ae20 100644
--- a/compiler/cpp/src/main.cc
+++ b/compiler/cpp/src/main.cc
@@ -157,6 +157,11 @@
int g_allow_neg_field_keys;
/**
+ * Whether or not 64-bit constants will generate a warning.
+ */
+int g_allow_64bit_consts = 0;
+
+/**
* Flags to control code generation
*/
bool gen_cpp = false;
@@ -647,6 +652,7 @@
fprintf(stderr, " --allow-neg-keys Allow negative field keys (Used to "
"preserve protocol\n");
fprintf(stderr, " compatibility with older .thrift files)\n");
+ fprintf(stderr, " --allow-64bit-consts Do not print warnings about using 64-bit constants\n");
fprintf(stderr, " --gen STR Generate code with a dynamically-registered generator.\n");
fprintf(stderr, " STR has the form language[:key1=val1[,key2,[key3=val3]]].\n");
fprintf(stderr, " Keys and values are options passed to the generator.\n");
@@ -980,6 +986,8 @@
gen_recurse = true;
} else if (strcmp(arg, "-allow-neg-keys") == 0) {
g_allow_neg_field_keys = true;
+ } else if (strcmp(arg, "-allow-64bit-consts") == 0) {
+ g_allow_64bit_consts = true;
} else if (strcmp(arg, "-gen") == 0) {
arg = argv[++i];
if (arg == NULL) {