Always exit with non-zero error code when printing warnings.

* gobject/glib-genmarshal.c: Add global exit_status variable, and use
it in pad() and process_signature() to return with non-zero error code
when printing warnings. (#495294)

svn path=/trunk/; revision=6098
This commit is contained in:
Mathias Hasselmann 2007-12-12 10:19:43 +00:00
parent 851f4a9b0f
commit a5427003d3
2 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2007-11-11 Mathias Hasselmann <mathias@openismus.com>
Always exit with non-zero error code when printing warnings.
* gobject/glib-genmarshal.c: Add global exit_status variable, and use
it in pad() and process_signature() to return with non-zero error code
when printing warnings. (#495294)
2007-12-11 Rahul Bhalerao <b.rahul.pm@gmail.com> 2007-12-11 Rahul Bhalerao <b.rahul.pm@gmail.com>
* configure.in: Added entry for Marathi Translations * configure.in: Added entry for Marathi Translations

View File

@ -123,6 +123,7 @@ static gboolean gen_cbody = FALSE;
static gboolean gen_internal = FALSE; static gboolean gen_internal = FALSE;
static gboolean skip_ploc = FALSE; static gboolean skip_ploc = FALSE;
static gboolean std_includes = TRUE; static gboolean std_includes = TRUE;
static gint exit_status = 0;
/* --- functions --- */ /* --- functions --- */
@ -283,6 +284,7 @@ pad (const gchar *string)
buffer = g_strdup_printf ("%s ", string); buffer = g_strdup_printf ("%s ", string);
g_warning ("overfull string (%u bytes) for padspace", g_warning ("overfull string (%u bytes) for padspace",
(guint) strlen (string)); (guint) strlen (string));
exit_status |= 2;
return buffer; return buffer;
} }
@ -464,6 +466,7 @@ process_signature (Signature *sig)
if (!complete_out_arg (sig->rarg)) if (!complete_out_arg (sig->rarg))
{ {
g_warning ("unknown type: %s", sig->rarg->keyword); g_warning ("unknown type: %s", sig->rarg->keyword);
exit_status |= 1;
return; return;
} }
for (node = sig->args; node; node = node->next) for (node = sig->args; node; node = node->next)
@ -473,6 +476,7 @@ process_signature (Signature *sig)
if (!complete_in_arg (iarg)) if (!complete_in_arg (iarg))
{ {
g_warning ("unknown type: %s", iarg->keyword); g_warning ("unknown type: %s", iarg->keyword);
exit_status |= 1;
return; return;
} }
} }
@ -604,7 +608,6 @@ main (int argc,
GScanner *scanner; GScanner *scanner;
GSList *slist, *files = NULL; GSList *slist, *files = NULL;
gint i; gint i;
gint result = 0;
/* parse args and do fast exits */ /* parse args and do fast exits */
parse_args (&argc, &argv); parse_args (&argc, &argv);
@ -665,7 +668,7 @@ main (int argc,
if (fd < 0) if (fd < 0)
{ {
g_warning ("failed to open \"%s\": %s", file, g_strerror (errno)); g_warning ("failed to open \"%s\": %s", file, g_strerror (errno));
result = 1; exit_status |= 1;
continue; continue;
} }
@ -724,7 +727,7 @@ main (int argc,
if (expected_token != G_TOKEN_NONE) if (expected_token != G_TOKEN_NONE)
{ {
g_scanner_unexp_token (scanner, expected_token, "type name", NULL, NULL, NULL, TRUE); g_scanner_unexp_token (scanner, expected_token, "type name", NULL, NULL, NULL, TRUE);
result = 1; exit_status |= 1;
break; break;
} }
@ -751,7 +754,7 @@ main (int argc,
g_hash_table_foreach_remove (marshallers, string_key_destroy, NULL); g_hash_table_foreach_remove (marshallers, string_key_destroy, NULL);
g_hash_table_destroy (marshallers); g_hash_table_destroy (marshallers);
return result; return exit_status;
} }
static void static void