From 77215d8a35e08559ab51d8440c57b6525ce76e41 Mon Sep 17 00:00:00 2001 From: Christian Lavoie Date: Sun, 7 Nov 2010 19:42:48 +0000 Subject: [PATCH] THRIFT-916: Fix warnings in C++ when compiling with -Wall. In this case, in the flex output, in the new c_glib generator and an actual bug in the parser that couldn't actually trigger. git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1032365 13f79535-47bb-0310-9956-ffa450edef68 --- compiler/cpp/src/generate/t_c_glib_generator.cc | 4 +--- compiler/cpp/src/parse/t_base_type.h | 2 +- compiler/cpp/src/thriftl.ll | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/cpp/src/generate/t_c_glib_generator.cc b/compiler/cpp/src/generate/t_c_glib_generator.cc index 223d4896..a569ae61 100644 --- a/compiler/cpp/src/generate/t_c_glib_generator.cc +++ b/compiler/cpp/src/generate/t_c_glib_generator.cc @@ -2981,6 +2981,4 @@ initial_caps_to_underscores (string name) } /* register this generator with the main program */ -THRIFT_REGISTER_GENERATOR(c_glib, "C, using GLib", ""); - - +THRIFT_REGISTER_GENERATOR(c_glib, "C, using GLib", "") diff --git a/compiler/cpp/src/parse/t_base_type.h b/compiler/cpp/src/parse/t_base_type.h index 1751df9b..d76772bc 100644 --- a/compiler/cpp/src/parse/t_base_type.h +++ b/compiler/cpp/src/parse/t_base_type.h @@ -84,7 +84,7 @@ class t_base_type : public t_type { } void set_string_enum(bool val) { - string_enum_ = true; + string_enum_ = val; } bool is_string_enum() const { diff --git a/compiler/cpp/src/thriftl.ll b/compiler/cpp/src/thriftl.ll index b8c36c3d..17ac818f 100644 --- a/compiler/cpp/src/thriftl.ll +++ b/compiler/cpp/src/thriftl.ll @@ -60,6 +60,11 @@ void integer_overflow(char* text) { */ %option noyywrap +/** + * We don't use it, and it fires up warnings at -Wall + */ +%option nounput + /** * Helper definitions, comments, constants, and whatnot */ -- 2.17.1