ggobi fails to build with clang

23 views
Skip to first unread message

Misty De Meo

unread,
Jul 17, 2012, 10:50:52 AM7/17/12
to gg...@googlegroups.com
In a few spots in ggobi, there is a "#line 0" directive. This builds on gcc, but clang throws an error because it doesn't consider 0 to be a positive integer:

"ggobi-renderer.c:54:7: error: #line directive requires a positive integer argument"

I'm unsure of exactly what the #line directive does, but ggobi does appear to build and run fine with clang and gcc if all instances of "#line 0" are changed to "#line 1".

See also:

The following patch fixes the issue:

diff --git a/src/ggobi-data.c b/src/ggobi-data.c
index ccb52dc..fbd756e 100644
--- a/src/ggobi-data.c
+++ b/src/ggobi-data.c
@@ -42,7 +42,7 @@ typedef GGobiDataClass SelfClass;
 /* here are local prototypes */
 static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
 static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
-#line 0 "data.gob"
+#line 1 "data.gob"
 static void ggobi_data_class_init (GGobiDataClass * c) G_GNUC_UNUSED;
 #line 48 "ggobi-data.c"
 #line 191 "data.gob"
diff --git a/src/ggobi-renderer-cairo.c b/src/ggobi-renderer-cairo.c
index 0b51ab6..12a47cf 100644
--- a/src/ggobi-renderer-cairo.c
+++ b/src/ggobi-renderer-cairo.c
@@ -57,10 +57,10 @@ struct _GGobiRendererCairoPrivate {
 /* here are local prototypes */
 static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
 static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
-#line 0 "renderer-cairo.gob"
+#line 1 "renderer-cairo.gob"
 static void ggobi_renderer_cairo_init (GGobiRendererCairo * o) G_GNUC_UNUSED;
 #line 63 "ggobi-renderer-cairo.c"
-#line 0 "renderer-cairo.gob"
+#line 1 "renderer-cairo.gob"
 static void ggobi_renderer_cairo_class_init (GGobiRendererCairoClass * c) G_GNUC_UNUSED;
 #line 66 "ggobi-renderer-cairo.c"
 #line 36 "renderer-cairo.gob"
diff --git a/src/ggobi-renderer-factory.c b/src/ggobi-renderer-factory.c
index ee1c93e..5be74bf 100644
--- a/src/ggobi-renderer-factory.c
+++ b/src/ggobi-renderer-factory.c
@@ -44,10 +44,10 @@ typedef GGobiRendererFactory Self;
 typedef GGobiRendererFactoryClass SelfClass;
 
 /* here are local prototypes */
-#line 0 "renderer-factory.gob"
+#line 1 "renderer-factory.gob"
 static void ggobi_renderer_factory_init (GGobiRendererFactory * o) G_GNUC_UNUSED;
 #line 50 "ggobi-renderer-factory.c"
-#line 0 "renderer-factory.gob"
+#line 1 "renderer-factory.gob"
 static void ggobi_renderer_factory_class_init (GGobiRendererFactoryClass * c) G_GNUC_UNUSED;
 #line 53 "ggobi-renderer-factory.c"
 static GGobiRenderer * ___real_ggobi_renderer_factory_create (GGobiRendererFactory * self, GdkDrawable * parent);
diff --git a/src/ggobi-renderer.c b/src/ggobi-renderer.c
index 1231145..7174c13 100644
--- a/src/ggobi-renderer.c
+++ b/src/ggobi-renderer.c
@@ -51,7 +51,7 @@ struct _GGobiRendererPrivate {
 /* here are local prototypes */
 static void ___object_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
 static void ___object_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
-#line 0 "renderer.gob"
+#line 1 "renderer.gob"
 static void ggobi_renderer_init (GGobiRenderer * o) G_GNUC_UNUSED;
 #line 57 "ggobi-renderer.c"
 static GdkDrawable * ___real_ggobi_renderer_create_target (GGobiRenderer * self, GdkDrawable * parent);

Michael Lawrence

unread,
Jul 18, 2012, 5:03:37 AM7/18/12
to Misty De Meo, gg...@googlegroups.com
These #line directives are generated by gob (GObject Builder). It is kind of a pain to have to patch generated files. Then again, I recently checked those files into svn, because getting gob to work on Windows is becoming increasingly difficult.

I have no idea what #line 0 would mean, since file lines are typically enumerated with 1-based indexes.

Thanks for the patch,
Michael


--
You received this message because you are subscribed to the Google Groups "GGobi users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ggobi/-/nXTVoMaAzj8J.
To post to this group, send email to gg...@googlegroups.com.
To unsubscribe from this group, send email to ggobi+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ggobi?hl=en.

Reply all
Reply to author
Forward
0 new messages