Re: Inconsistency between the declaration of three function prototypes in header file gprolog.h and atom.h

"Gustavo Brown - INCO" <[email protected]> Mon, 6 Oct 2014 11:47:48 -0300
Newsgroups gmane.comp.gnu.prolog.bugs
Message-ID <87E2A24CB6154BC2B722046BA8811133@VirtualXP99969>
This is a multi-part message in MIME format.

--===============5726355576862561686==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_00E5_01CFE15B.5A219EA0"

This is a multi-part message in MIME format.

------=_NextPart_000_00E5_01CFE15B.5A219EA0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

I am including gprolog.h and engine_pl.h which in turn itself includes =
atom.h
The reason to include engine_pl.h is to access some structures of the =
gprolog engine (AtomInfo, WamWord, etc) to perform some mark & sweep =
cleanup (GC) of the atom table.
However i also need access to some high level functions declared in =
gprolog.h (Pl_Create_Atom, etc).

Regards,
   Gustavo
  ----- Original Message -----=20
  From: Daniel Diaz=20
  To: Gustavo Brown - INCO=20
  Cc: [email protected]=20
  Sent: Sunday, October 05, 2014 6:00 AM
  Subject: Re: Inconsistency between the declaration of three function =
prototypes in header file gprolog.h and atom.h


  Thank for this report,


  note however that normally you don=92t need to include both gprolog.h =
and atom.h.
  Can you check why do you need this ?


  Daniel




  Le 2 oct. 2014 =E0 20:06, Gustavo Brown - INCO <[email protected]> a =
=E9crit :



    Hi,
     There is an inconsistency between the declaration of function =
prototypes in header file gprolog.h
        int Pl_Create_Atom(const char *atom)
        int Pl_Create_Allocate_Atom(const char *atom)
        int Pl_Find_Atom(const char *atom)

    and the declaration of the same function prototypes in atom.h, in =
which the argument (atom) is not const.
    The definition of those functions (in atom.c) do not have the =
argument marked as const either.

    This gives an error when compiling a project which includes =
gprolog.h with Visual Studio 2008 (second C linkage of overloaded =
function XXX not allowed).

    Machine using: Windows 7
    GNU Prolog version 1.4.4

    Regards,
       Gustavo

    --=20
    Ce message a =E9t=E9 v=E9rifi=E9 par MailScanner pour des virus ou =
des polluriels et rien de suspect n'a =E9t=E9 trouv=E9. =
_______________________________________________
    Bug-prolog mailing list
    [email protected]
    https://lists.gnu.org/mailman/listinfo/bug-prolog




  --=20
  Ce message a =E9t=E9 v=E9rifi=E9 par MailScanner pour des virus ou des =
polluriels et rien de suspect n'a =E9t=E9 trouv=E9. 
------=_NextPart_000_00E5_01CFE15B.5A219EA0
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dwindows-1252" =
http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 8.00.6001.23588">
<STYLE></STYLE>
</HEAD>
<BODY=20
style=3D"WORD-WRAP: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space"=20
bgColor=3D#ffffff>
<DIV><FONT size=3D2 face=3DArial>I am including gprolog.h and =
engine_pl.h which in=20
turn itself includes&nbsp;atom.h</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>The reason to include engine_pl.h is to =
access some=20
structures of the gprolog engine (AtomInfo, WamWord, etc) to perform =
some mark=20
&amp; sweep cleanup (GC) of the atom table.</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>However i also need&nbsp;access to some =
high level=20
functions declared in gprolog.h (Pl_Create_Atom, etc).</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2 face=3DArial>Regards,</FONT></DIV>
<DIV><FONT size=3D2 face=3DArial>&nbsp;&nbsp; Gustavo</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; =
PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: =
black"><B>From:</B>=20
  <A [email protected]=20
  href=3D"mailto:[email protected]">Daniel Diaz</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
[email protected]=20
  href=3D"mailto:[email protected]">Gustavo Brown - INCO</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Cc:</B> <A =
[email protected]=20
  href=3D"mailto:[email protected]">[email protected]</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Sunday, October 05, 2014 =
6:00=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: Inconsistency =
between the=20
  declaration of three function prototypes in header file gprolog.h and=20
  atom.h</DIV>
  <DIV><BR></DIV>Thank for this report,
  <DIV><BR></DIV>
  <DIV>note however that normally you don=92t need to include both =
gprolog.h and=20
  atom.h.</DIV>
  <DIV>Can you check why do you need this ?</DIV>
  <DIV><BR></DIV>
  <DIV>Daniel</DIV>
  <DIV><BR></DIV>
  <DIV><BR>
  <DIV>
  <DIV>Le 2 oct. 2014 =E0 20:06, Gustavo Brown - INCO &lt;<A=20
  href=3D"mailto:[email protected]">[email protected]</A>&gt; a =
=E9crit :</DIV><BR=20
  class=3DApple-interchange-newline>
  <BLOCKQUOTE type=3D"cite">
    <DIV=20
    style=3D"TEXT-TRANSFORM: none; TEXT-INDENT: 0px; FONT: 16px =
LucidaGrande; WHITE-SPACE: normal; LETTER-SPACING: normal; WORD-SPACING: =
0px; -webkit-text-stroke-width: 0px"=20
    bgcolor=3D"#ffffff">
    <DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
    <DIV><FONT size=3D2 face=3DArial>Hi,</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial>&nbsp;There is an inconsistency =
between the=20
    declaration of function prototypes in header file =
gprolog.h</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial>&nbsp;&nbsp;&nbsp; int =
Pl_Create_Atom(const=20
    char *atom)</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial>&nbsp;&nbsp;&nbsp; int=20
    Pl_Create_Allocate_Atom(const char *atom)</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial>&nbsp;&nbsp;&nbsp; int =
Pl_Find_Atom(const char=20
    *atom)</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
    <DIV><FONT size=3D2 face=3DArial>and the declaration of the same =
function=20
    prototypes in atom.h, in which the argument (atom) is not=20
const.</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial>The definition of those functions =
(in atom.c)=20
    do not have the argument marked as const either.</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
    <DIV><FONT size=3D2 face=3DArial>This gives an error when compiling =
a project=20
    which includes gprolog.h with Visual Studio 2008 (second C linkage =
of=20
    overloaded function XXX not allowed).</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
    <DIV><FONT size=3D2 face=3DArial>Machine using: Windows =
7</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial>GNU Prolog version =
1.4.4</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial></FONT>&nbsp;</DIV>
    <DIV><FONT size=3D2 face=3DArial>Regards,</FONT></DIV>
    <DIV><FONT size=3D2 face=3DArial>&nbsp;&nbsp; =
Gustavo</FONT></DIV><BR>--<SPAN=20
    class=3DApple-converted-space>&nbsp;</SPAN><BR>Ce message a =E9t=E9 =
v=E9rifi=E9=20
    par<SPAN class=3DApple-converted-space>&nbsp;</SPAN><A=20
    href=3D"http://www.mailscanner.info/">MailScanner</A><SPAN=20
    class=3DApple-converted-space>&nbsp;</SPAN>pour des virus ou des =
polluriels et=20
    rien de suspect n'a =E9t=E9 trouv=E9.=20
    _______________________________________________<BR>Bug-prolog =
mailing=20
    list<BR><A =
href=3D"mailto:[email protected]">[email protected]</A><BR><A=20
    =
href=3D"https://lists.gnu.org/mailman/listinfo/bug-prolog">https://lists.=
gnu.org/mailman/listinfo/bug-prolog</A><BR></DIV></BLOCKQUOTE></DIV><BR><=
/DIV><BR>--=20
  <BR>Ce message a =E9t=E9 v=E9rifi=E9 par <A=20
  href=3D"http://www.mailscanner.info/">MailScanner</A> pour des virus =
ou des=20
  polluriels et rien de suspect n'a =E9t=E9 trouv=E9. =
</BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00E5_01CFE15B.5A219EA0--



--===============5726355576862561686==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bug-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-prolog

--===============5726355576862561686==--