Thread overview
const keyword wrongly interpreted - misc.c
Oct 12, 2004
Benoit Tremblay
Oct 12, 2004
J C Calvarese
Oct 13, 2004
Walter
October 12, 2004
Hi,
I am trying to compile the watt-32 library with digital mars. I got only 4 files
that wasn't compiled by digital mars. I was unable to fix the compilation errror
and think now that it is an issue with de digital mars compiler.

Here is the error ouput of the first file:

c:\djgpp\bin\dmc -ml -a2 -I. -I..\inc -IC:\dm\include -W -fno-strength-reduce -f
fast-math  -o digmars/misc.o -c misc.c
misc.c:
((int(far *)(void const const *, void const const *))list_compare));
^
misc.c(463) : Error: need explicit cast for function parameter 4 to get
from: int (*far C func)(void *,void *)
to  : int (*far C func)(void const *,void const *)
--- errorlevel 1
make.exe: *** [digmars/misc.o] Error 1

C:\net\watt\src>

The cast is exactly as requested by the compiler. I try all sort of variation and I am unable to please digital mars. I feel that digital mars have some difficulty with the "const" keyword.

I got similar error with 3 other files.

thank you

Benoit

Benoit Tremblay
trembb22@hotmail.com
October 12, 2004
Benoit Tremblay wrote:
> Hi,
> I am trying to compile the watt-32 library with digital mars. I got only 4 files
> that wasn't compiled by digital mars. I was unable to fix the compilation errror
> and think now that it is an issue with de digital mars compiler.
> 
> Here is the error ouput of the first file:
> 
> c:\djgpp\bin\dmc -ml -a2 -I. -I..\inc -IC:\dm\include -W -fno-strength-reduce -f
> fast-math  -o digmars/misc.o -c misc.c
> misc.c:
> ((int(far *)(void const const *, void const const *))list_compare));
> ^
> misc.c(463) : Error: need explicit cast for function parameter 4 to get
> from: int (*far C func)(void *,void *)
> to  : int (*far C func)(void const *,void const *)
> --- errorlevel 1
> make.exe: *** [digmars/misc.o] Error 1


This newsgroup is for reporting bugs in the D Programming Languages. You probably meant to post to one of the C++ newsgroups. Here are some ideas:

c++
c++.stl
c++.stl.hp
c++.stl.sgi
c++.stl.port
c++.idde
c++.command-line
c++.rtl
c++.mfc
c++.atl
c++.announce
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.chat
c++.beta
c++.stlsoft
c++.wxwindows



-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/
October 13, 2004
I believe the compiler is correct. You can fix the problem in the code by using a cast.

"Benoit Tremblay" <Benoit_member@pathlink.com> wrote in message news:ckh468$14ga$1@digitaldaemon.com...
> Hi,
> I am trying to compile the watt-32 library with digital mars. I got only 4
files
> that wasn't compiled by digital mars. I was unable to fix the compilation
errror
> and think now that it is an issue with de digital mars compiler.
>
> Here is the error ouput of the first file:
>
>
c:\djgpp\bin\dmc -ml -a2 -I. -I..\inc -IC:\dm\include -W -fno-strength-reduc e -f
> fast-math  -o digmars/misc.o -c misc.c
> misc.c:
> ((int(far *)(void const const *, void const const *))list_compare));
> ^
> misc.c(463) : Error: need explicit cast for function parameter 4 to get
> from: int (*far C func)(void *,void *)
> to  : int (*far C func)(void const *,void const *)
> --- errorlevel 1
> make.exe: *** [digmars/misc.o] Error 1
>
> C:\net\watt\src>
>
> The cast is exactly as requested by the compiler. I try all sort of
variation
> and I am unable to please digital mars. I feel that digital mars have some difficulty with the "const" keyword.
>
> I got similar error with 3 other files.
>
> thank you
>
> Benoit
>
> Benoit Tremblay
> trembb22@hotmail.com
>