After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 539483 - GCC warning when using array of Gtk.ActionEntry with callback specified
GCC warning when using array of Gtk.ActionEntry with callback specified
Status: RESOLVED DUPLICATE of bug 526874
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-21 16:35 UTC by Stef Walter
Modified: 2008-06-22 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stef Walter 2008-06-21 16:35:30 UTC
I get this warning from gcc:

    test.c:28: warning: initialization from incompatible pointer type

When using compiling the following code. The on_test_command callback is not properly cast with G_CALLBACK() when initializing the static array in the C code.

/* 
 * valac --pkg gtk+-2.0 -o test test.vala
 */

using GLib;
using Gtk;

namespace Test {
	public class Test : GLib.Object {

		private ActionGroup actions;

		private static const ActionEntry[] COMMAND_ACTIONS = {
			{ "test-command", null, "Test Command", "",
			  "Description of test command.", on_test_command }
		};

		construct {
			actions = new ActionGroup("test-group");
			actions.add_actions(COMMAND_ACTIONS, this);
		}

		private void on_test_command (Action action) {
			stdout.printf ("blah\n");
		}

		public static void main(string[] args) {
			var test = new Test();
		}
	}
}
Comment 1 Jared Moore 2008-06-22 13:17:27 UTC
Possibly a dupe of 526874?
Comment 2 Jürg Billeter 2008-06-22 13:22:42 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 526874 ***