For some reason the G_GNUC_CONST / G_GNUC_PURE attributes on generated
get_type function declarations are not currently covered by the --no-gnu
option. This seems unexpected, so let's get those suppressed.
" * Public methods\n"
" */\n");
" * Public methods\n"
" */\n");
- if (!overrode_get_type) {
+ if (!overrode_get_type && !no_gnu) {
/*
* For ordinary "static" types it should be safe to mark the
* get_type implementation as const, since the get_type
/*
* For ordinary "static" types it should be safe to mark the
* get_type implementation as const, since the get_type
g_free (str);
out_printf (outh, "%s_get_type()\n", funcprefix);
g_free (str);
out_printf (outh, "%s_get_type()\n", funcprefix);
- out_printf (outh, "GType %s_get_type (void) G_GNUC_CONST;\n\n", funcprefix);
+ out_printf (outh, "GType %s_get_type (void)%s;\n\n",
+ funcprefix, no_gnu ? "": " G_GNUC_CONST");
out_printf (out,
"GType\n%s_get_type (void)\n"
out_printf (out,
"GType\n%s_get_type (void)\n"
g_free (str);
out_printf (outh, "%s_get_type()\n", funcprefix);
g_free (str);
out_printf (outh, "%s_get_type()\n", funcprefix);
- out_printf (outh, "GType %s_get_type (void) G_GNUC_CONST;\n\n", funcprefix);
+ out_printf (outh, "GType %s_get_type (void)%s;\n\n",
+ funcprefix, no_gnu ? "" : " G_GNUC_CONST");
out_printf (out,
"GType\n%s_get_type (void)\n"
out_printf (out,
"GType\n%s_get_type (void)\n"
g_free (str);
out_printf (outh, "%s_get_type ()\n", funcprefix);
g_free (str);
out_printf (outh, "%s_get_type ()\n", funcprefix);
- out_printf (outh, "GType %s_get_type (void) G_GNUC_CONST;\n\n", funcprefix);
+ out_printf (outh, "GType %s_get_type (void)%s;\n\n",
+ funcprefix, no_gnu ? "" : " G_GNUC_CONST");
out_printf (out,
"GType\n%s_get_type (void)\n"
out_printf (out,
"GType\n%s_get_type (void)\n"
-# --no-gnu is currently busted for the get_type function declaration.
-AT_XFAIL_IF([:])
-
AT_CHECK([gob2 test.gob])
AT_CHECK([cat test*.h test.c | grep '_GNUC_' >/dev/null], [0])
AT_CHECK([gob2 test.gob])
AT_CHECK([cat test*.h test.c | grep '_GNUC_' >/dev/null], [0])