[CLAIR-devel] On the declaration of PL_extension

Roberto Bagnara bagnara at cs.unipr.it
Wed Dec 5 12:37:08 CET 2007


That struct is currently declared as:

typedef struct PL_extension
{ char 		*predicate_name;	/* Name of the predicate */
   short		arity;			/* Arity of the predicate */
   pl_function_t	function;		/* Implementing functions */
   short		flags;			/* Or of PL_FA_... */
} PL_extension;

Using it in the most natural way, i.e., with something like,

#define C_PREDICATE_ENTRY(name, arity) \
   { #name, arity, (pl_function_t) name, 0 },

PL_extension c_predicates[] = {
   C_PREDICATE_ENTRY(acs_any_svalue, 3)
   C_PREDICATE_ENTRY(acs_approximate_stack, 3)
   ...

gives lots of warning with newer versions of GCC (such as
4.2.2):

...  warning: deprecated conversion from string constant to 'char*'

Usually, features that are deprecated in GCC version x are removed
in version x+1.  In any case, would it be possible/sensible to declare
the `predicate_name' field as `const char*' instead of `char*'?
All the best,

     Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the CLAIR-devel mailing list