THRIFT-3288 c_glib: Build unit tests without compiler warnings
These changes allow the unit tests for C (GLib) to build without
compiler warnings, even with additional warnings enabled. They
include
- Disabling string-function optimizations when glibc is used, as
these produce compiler warnings when a string function is used
within a call to assert ();
- Remove the "LL" suffix (added in C99) from 64-bit integer
literals;
- Replace C++-style ("//") comments with C-style equivalents;
- Remove unused constant declarations that generated warnings;
and
- Mark (or remove, from main ()) unused function parameters.
diff --git a/lib/c_glib/test/testoptionalrequired.c b/lib/c_glib/test/testoptionalrequired.c
index 931d8be..ae0c3d2 100755
--- a/lib/c_glib/test/testoptionalrequired.c
+++ b/lib/c_glib/test/testoptionalrequired.c
@@ -74,7 +74,7 @@
s2 = g_object_new (T_TEST_TYPE_SIMPLE, NULL);
s3 = g_object_new (T_TEST_TYPE_SIMPLE, NULL);
- // write-to-read with optional fields
+ /* write-to-read with optional fields */
s1->im_optional = 10;
assert (s1->__isset_im_default == FALSE);
assert (s1->__isset_im_optional == FALSE);
@@ -174,7 +174,7 @@
t2 = g_object_new (T_TEST_TYPE_TRICKY2, NULL);
t3 = g_object_new (T_TEST_TYPE_TRICKY3, NULL);
- // throws protocol exception
+ /* throws protocol exception */
write_to_read (THRIFT_STRUCT (t2), THRIFT_STRUCT (t3), NULL, &read_error);
assert (read_error != NULL);
g_error_free (read_error);