Hi,
while compiling GUI, I get these errors abount string constants.
Compiling file externs.m ...
externs.m:270:1: error: initializer element is not constant
NSString *const NSStringPboardType = NSPasteboardTypeString;
^
externs.m:273:1: error: initializer element is not constant
NSString *const NSColorPboardType = NSPasteboardTypeColor;
^
externs.m:276:1: error: initializer element is not constant
NSString *const NSFontPboardType = NSPasteboardTypeFont;
^
externs.m:279:1: error: initializer element is not constant
NSString *const NSRulerPboardType = NSPasteboardTypeRuler;
^
externs.m:282:1: error: initializer element is not constant
NSString *const NSTabularTextPboardType = NSPasteboardTypeTabularText;
<...>
What is the issue? I see the definition here:
Headers/AppKit/NSPasteboard.h:APPKIT_EXPORT NSString *const
NSPasteboardTypeString;
Source/externs.m:NSString *const NSPasteboardTypeString =
@"NSStringPboardType";
and it is declared as *const.
NSString *const is not "constant" to initialize a definition (I tried
"const NSString *const" too but it doesn't work: constant string to a
constant pointer)
The only working way I found is not to use the previous string
delcaration in the next one, e.g.:
NSString *const NSPasteboardTypeString = @"NSStringPboardType";
NSString *const NSStringPboardType = @"NSStringPboardType";
instead of
NSString *const NSStringPboardType = NSPasteboardTypeString;
thins fixes my compilation issue, but I am hesitating to commit this
since it looks "stupid" to me
What is GCC doing here or what I am overlooking?
Riccardo
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev