Hi!
> Yes, I know the difference, but 'char *file = "foo"' will generate a
> compiling error like:
> 
> setxattr02.c:88:3: error: initializer element is not constant
> setxattr02.c:88:3: error: (near initialization for ???tc[0].fname???)
> 
> So I used 'char file[] = "foo"'.
> 
> That turns out to be a limitation of the C language. Quote the spec
> 
> "All the expressions in an initializer for an object that has static
> storage duration shall be constant expressions or string literals."
> 
> Will macro be a better way? Like:
> #define FILENAME "setxattr02testfile"
> #define DIRNAME "setxattr02testdir"
> 

Ah, I see.

I think macros are better option here.

-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to