[CLAIR-devel] [Fwd: Re: [SWIPL] On the declaration of PL_extension]

Roberto Bagnara bagnara at cs.unipr.it
Thu Dec 6 11:13:59 CET 2007



-------- Original Message --------
Subject: Re: [SWIPL] On the declaration of PL_extension
Date: Wed, 5 Dec 2007 14:03:39 +0100
From: Jan Wielemaker <wielemak at science.uva.nl>
Organization: HCS, University of Amsterdam
To: prolog at science.uva.nl
References: <47568D64.7010103 at cs.unipr.it>

Hi Roberto,

Patched.  If you happen to install from GIT, please test it and see it
doesn't give warning anywhere else.

	--- Jan

On Wednesday 05 December 2007 12:37, Roberto Bagnara wrote:
> 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



------------
For further info, please visit http://www.swi-prolog.org/

To unsubscribe, send a plaintext mail with "unsubscribe prolog <e-mail>"
in its body to majordomo at science.uva.nl


-- 
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