why computer programming is not fun

Same instructions, similar toolchains, identical code base: why on one system do I get a “parse error:” In file included from core/compositor.c:42: /opt/local/include/X11/extensions/damageproto.h:140: error: parse error before ‘xRectangle’ /opt/local/include/X11/extensions/damageproto.h:140: warning: no semicolon at end of struct or union /opt/local/include/X11/extensions/damageproto.h:141: warning: type defaults to ‘int’ in declaration of ‘geometry’ /opt/local/include/X11/extensions/damageproto.h:141: warning: data definition has no type or storage class /opt/local/include/X11/extensions/damageproto.h:142: warning: type defaults to ‘int’ in declaration of ‘xDamageNotifyEvent’ /opt/local/include/X11/extensions/damageproto.h:142: warning: data definition has no type or storage class core/compositor.c:124: error: parse error before ‘XserverRegion’ but the same identical source files build without issue on another system? My admittedly limited experience in C doesn’t point out any obvious flaws in this struct: 133 typedef struct { 134 CARD8 type; 135 CARD8 level; 136 CARD16 sequenceNumber B16; 137 Drawable drawable B32; 138 Damage damage B32; 139 Time timestamp B32; 140 xRectangle area; 141 xRectangle geometry; 142 } xDamageNotifyEvent; So perhaps it’s in another header or source file or perhaps how this definition is used by the file that calls it.

I’m not even trying to write any code, simply trying to build something that works over here but fails over there. Same instructions, similar toolchains, identical code base: why on one system do I get a “parse error:”

In file included from core/compositor.c:42:
/opt/local/include/X11/extensions/damageproto.h:140: error: parse error before 'xRectangle'
/opt/local/include/X11/extensions/damageproto.h:140: warning: no semicolon at end of struct or union
/opt/local/include/X11/extensions/damageproto.h:141: warning: type defaults to 'int' in declaration of 'geometry'
/opt/local/include/X11/extensions/damageproto.h:141: warning: data definition has no type or storage class
/opt/local/include/X11/extensions/damageproto.h:142: warning: type defaults to 'int' in declaration of 'xDamageNotifyEvent'
/opt/local/include/X11/extensions/damageproto.h:142: warning: data definition has no type or storage class
core/compositor.c:124: error: parse error before 'XserverRegion'

but the same identical source files build without issue on another system?

My admittedly limited experience in C doesn’t point out any obvious flaws in this struct:


133 typedef struct {
134 CARD8 type;
135 CARD8 level;
136 CARD16 sequenceNumber B16;
137 Drawable drawable B32;
138 Damage damage B32;
139 Time timestamp B32;
140 xRectangle area;
141 xRectangle geometry;
142 } xDamageNotifyEvent;

So perhaps it’s in another header or source file or perhaps how this definition is used by the file that calls it. Not that the error message says that . . .

This brings up something that many young hackers may never run into: a lot of computer programming work is maintenance. But unlike hardware maintenance, with identical FRUs and well-tested diagnostics, software is not nearly as consistently standardized. One person’s clever shortcut is another’s unspeakable kludge.

It’s stuff like the error messages above that confirm my unsuitability for software engineering. For all its logic and structure, sometimes it seem like rough carpentry — measure once, shim to fit.

Leave a Reply

Your email address will not be published. Required fields are marked *