2023-12-23 10:56 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
 * contrib\hbhpdf\hpdf_shading.c
   ! moved declaration to allow compilation with BCC32 non-CLANG
2023-12-23 10:46 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
 * contrib\hbhpdf\hpdf_utils.c
   ! removed inline declaration to allow compilation with BCC32 non-CLANG
Ok, now I get this with MSC32:
contrib\hbhpdf\hpdf_utils.c(223): warning C4244: 'function': conversion
from 'double' to 'float', possible loss of data contrib\hbhpdf\hpdf_utils.c(238): warning C4244: 'function': conversion
from 'double' to 'float', possible loss of data
What can I do to fix these warnings without touching the code?...
Il 23/12/2023 10:59, Enrico Maria Giordano ha scritto:
2023-12-23 10:56 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
* contrib\hbhpdf\hpdf_shading.c
! moved declaration to allow compilation with BCC32 non-CLANG
2023-12-23 10:46 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
* contrib\hbhpdf\hpdf_utils.c
! removed inline declaration to allow compilation with BCC32 non-CLANG
Ok, now I get this with MSC32:
contrib\hbhpdf\hpdf_utils.c(223): warning C4244: 'function': conversion
from 'double' to 'float', possible loss of data contrib\hbhpdf\hpdf_utils.c(238): warning C4244: 'function': conversion
from 'double' to 'float', possible loss of data
What can I do to fix these warnings without touching the code?...
Ok, now I get this with MSC32:
contrib\hbhpdf\hpdf_utils.c(223): warning C4244: 'function': conversion
from 'double' to 'float', possible loss of data
contrib\hbhpdf\hpdf_utils.c(238): warning C4244: 'function': conversion
from 'double' to 'float', possible loss of data
What can I do to fix these warnings without touching the code?...
You can possibly disable warnings for hbhpdf (look at CCC_CMD) or better
add CCC_CMD_NO_WARNINGS (in such case it will have to be added to makefile.(all other compilers).
Ok, now I get this with MSC32:
contrib\hbhpdf\hpdf_utils.c(223): warning C4244: 'function':
conversion from 'double' to 'float', possible loss of data
contrib\hbhpdf\hpdf_utils.c(238): warning C4244: 'function':
conversion from 'double' to 'float', possible loss of data
What can I do to fix these warnings without touching the code?...
This is the line 223:
dig = modff(int_val/10.0, &int_val);
The first argument (int_val/10.0) is of double type while modff() wants
a float.
The first argument (int_val/10.0) is of double type while modff()
wants a float.
For the moment I will fix the warnings, please don't yell at me. :-)
What can I do to fix these warnings without touching the code?...
You can possibly disable warnings for hbhpdf (look at CCC_CMD) or better
add CCC_CMD_NO_WARNINGS (in such case it will have to be added to makefile.(all other compilers).
CCC_CMD is for all the modules, not for a single module, isn't it? I did
not understand your second suggestion (CCC_CMD_NO_WARNINGS), sorry.
The first argument (int_val/10.0) is of double type while modff()
wants a float.
For the moment I will fix the warnings, please don't yell at me. :-)
I changed my mind. Too much warnings in other modules of harupdf. I have
to disable the warnings only for harupdf. Can it be done? How exactly?
Il 23/12/2023 17:19, Ron Pinkas ha scritto:
What can I do to fix these warnings without touching the code?...
You can possibly disable warnings for hbhpdf (look at CCC_CMD) or better add CCC_CMD_NO_WARNINGS (in such case it will have to be added to makefile.(all other compilers).
CCC_CMD is for all the modules, not for a single module, isn't it? I did
not understand your second suggestion (CCC_CMD_NO_WARNINGS), sorry.
Il 23/12/2023 19:27, Enrico Maria Giordano ha scritto:
The first argument (int_val/10.0) is of double type while modff() wants a float.
For the moment I will fix the warnings, please don't yell at me. :-)
I changed my mind. Too much warnings in other modules of harupdf. I have
to disable the warnings only for harupdf. Can it be done? How exactly?
Unfortunately I can't see any way other than fixing the warnings in
contrib code. Tomorrow I will start doing it again.
Unfortunately I can't see any way other than fixing the warnings in
contrib code. Tomorrow I will start doing it again.
Why? Warnings are not a show stopper, and can be ignored or silenced.
Yes, but then what is the purpose of showing warnings if not to be
fixed? I don't understand. Anyway, ok, I received the message loud and
clear: I quit to fix warnings, I will just try to silence them.
CCC_CMD is for all the modules, not for a single module, isn't it? I did
not understand your second suggestion (CCC_CMD_NO_WARNINGS), sorry.
Enrico,
In compile.mak you can find the list of all modules for each lib. Look
at lines 6107 to 6285 for the hbhpdf.lib and harupdf.lib. They are
currently compiled with macro CCC_CMD you can change ALL of these to CCC_CMD_NOWARNING which is a NEW MACRO. Therefore you then need to
define the new macro for each compiler in the makefile.vc, makefile.bc,
etc. as a COPY from CCC_CMD plus additional swittch (or remove switch)
to disable warnings.
If you need more info send me an email so I can forward my WhatsApp
number.
This should be a simpler approach for compiling 3rd party code tthat has warnings that you do nott wish to see.
In compile.mak you can find the list of all modules for each lib. Look
at lines 6107 to 6285 for the hbhpdf.lib and harupdf.lib. They are
currently compiled with macro CCC_CMD you can change ALL of these to CCC_CMD_NOWARNING which is a NEW MACRO. Therefore you then need to
define the new macro for each compiler in the makefile.vc, makefile.bc,
etc. as a COPY from CCC_CMD plus additional swittch (or remove switch)
to disable warnings.
Il 24/12/2023 10:19, Enrico Maria Giordano ha scritto:
Yes, but then what is the purpose of showing warnings if not to be
fixed? I don't understand. Anyway, ok, I received the message loud and clear: I quit to fix warnings, I will just try to silence them.
But I will continue to fix the warnings in core xHarbour code, ok?
Il 24/12/2023 02:14, Ron Pinkas ha scritto:
In compile.mak you can find the list of all modules for each lib. Look
at lines 6107 to 6285 for the hbhpdf.lib and harupdf.lib. They are currently compiled with macro CCC_CMD you can change ALL of these to CCC_CMD_NOWARNING which is a NEW MACRO. Therefore you then need to
define the new macro for each compiler in the makefile.vc, makefile.bc, etc. as a COPY from CCC_CMD plus additional swittch (or remove switch)
to disable warnings.
Ok, I added two new macros
CC_CMD_NOWARN
CCC_CMD_NOWARN
and silenced some MSC warnings. Now I get these errors:
contrib\hbhpdf\hpdf_encoder.c(2225): error C2440: '=': cannot convert
from 'void *' to 'HPDF_Encoder'
contrib\hbhpdf\hpdf_encoder.c(2225): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2242): error C2440: '=': cannot convert
from 'void *' to 'HPDF_BasicEncoderAttr'
contrib\hbhpdf\hpdf_encoder.c(2242): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2534): error C2440: '=': cannot convert
from 'void *' to 'HPDF_Encoder'
contrib\hbhpdf\hpdf_encoder.c(2534): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2567): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CMapEncoderAttr'
contrib\hbhpdf\hpdf_encoder.c(2567): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2642): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2642): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2652): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2652): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2662): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2662): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2775): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2775): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2803): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2803): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
They can be fixed compiling in C mode. But I'm not sure how to force C
mode for a single module. Do I have to create one more macro like
CCC_CMD_HBHPDF =$(CC) -wd4244 $(CLIBFLAGS) -Fo$@ $**
? Please confirm.
But I will continue to fix the warnings in core xHarbour code, ok?
Of course I also want to fix all warnings and hat to see them. The only reason I warned you against fixing is specifically 3rd party code of
LIVE projects.
Now I get these errors:
contrib\hbhpdf\hpdf_encoder.c(2225): error C2440: '=': cannot convert
from 'void *' to 'HPDF_Encoder'
contrib\hbhpdf\hpdf_encoder.c(2225): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
contrib\hbhpdf\hpdf_encoder.c(2242): error C2440: '=': cannot convert
from 'void *' to 'HPDF_BasicEncoderAttr'
contrib\hbhpdf\hpdf_encoder.c(2242): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
contrib\hbhpdf\hpdf_encoder.c(2534): error C2440: '=': cannot convert
from 'void *' to 'HPDF_Encoder'
contrib\hbhpdf\hpdf_encoder.c(2534): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
contrib\hbhpdf\hpdf_encoder.c(2567): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CMapEncoderAttr'
contrib\hbhpdf\hpdf_encoder.c(2567): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
contrib\hbhpdf\hpdf_encoder.c(2642): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2642): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
contrib\hbhpdf\hpdf_encoder.c(2652): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2652): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
contrib\hbhpdf\hpdf_encoder.c(2662): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2662): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
contrib\hbhpdf\hpdf_encoder.c(2775): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2775): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
contrib\hbhpdf\hpdf_encoder.c(2803): error C2440: '=': cannot convert
from 'void *' to 'HPDF_CidRange_Rec *'
contrib\hbhpdf\hpdf_encoder.c(2803): note: Conversion from 'void*' to
pointer to non-'void' requires an explicit cast
They can be fixed compiling in C mode. But I'm not sure how to force C
mode for a single module. Do I have to create one more macro like
CCC_CMD_HBHPDF =$(CC) -wd4244 $(CLIBFLAGS) -Fo$@ $**
? Please confirm.
Sorry I don't understand, The whole of hbhpd.libf (and harupdf.lib) is already compiling with MSVC in C mode, withOUT errors.
Is there an easy way to find older (ie. not LIVE) 3rd party code? As an example, what do you think of this?
contrib\hbmzip\unzip.c(1053): warning C4456: declaration of 'uL' hides previous local declaration
Can I fix it or is still a LIVE code?
Il 24/12/2023 16:24, Ron Pinkas ha scritto:
But I will continue to fix the warnings in core xHarbour code, ok?
Of course I also want to fix all warnings and hat to see them. The only reason I warned you against fixing is specifically 3rd party code of
LIVE projects.
Is there an easy way to find older (ie. not LIVE) 3rd party code? As an example, what do you think of this?
contrib\hbmzip\unzip.c(1053): warning C4456: declaration of 'uL' hides previous local declaration
Can I fix it or is still a LIVE code?
I would prefer to exclude warning C4244 only for hpdf_utils.c. Is it
possible?
And only for MSC.
Yes. You can modify the MACRO used for just this source from CCC_CMD to
new CCC_CMD_NOWARN (assuming CCC_CMD_NOWARN is copy of CCC_CMD with
disable warning)
Il 24/12/2023 16:40, Enrico Maria Giordano ha scritto:
Is there an easy way to find older (ie. not LIVE) 3rd party code? As an example, what do you think of this?
contrib\hbmzip\unzip.c(1053): warning C4456: declaration of 'uL' hides previous local declaration
Can I fix it or is still a LIVE code?
It looks like a LIVE code:
https://github.com/madler/zlib/blob/master/contrib/minizip/unzip.c
So, do I have to create a new macro CCC_CMD_MZIP and add -wd4456 to it? Please confirm.
Il 24/12/2023 16:32, Ron Pinkas ha scritto:
Now I get these errors:
contrib\hbhpdf\hpdf_encoder.c(2225): error C2440: '=': cannot convert from 'void *' to 'HPDF_Encoder'
contrib\hbhpdf\hpdf_encoder.c(2225): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2242): error C2440: '=': cannot convert from 'void *' to 'HPDF_BasicEncoderAttr' contrib\hbhpdf\hpdf_encoder.c(2242): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2534): error C2440: '=': cannot convert from 'void *' to 'HPDF_Encoder'
contrib\hbhpdf\hpdf_encoder.c(2534): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2567): error C2440: '=': cannot convert from 'void *' to 'HPDF_CMapEncoderAttr' contrib\hbhpdf\hpdf_encoder.c(2567): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2642): error C2440: '=': cannot convert from 'void *' to 'HPDF_CidRange_Rec *' contrib\hbhpdf\hpdf_encoder.c(2642): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2652): error C2440: '=': cannot convert from 'void *' to 'HPDF_CidRange_Rec *' contrib\hbhpdf\hpdf_encoder.c(2652): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2662): error C2440: '=': cannot convert from 'void *' to 'HPDF_CidRange_Rec *' contrib\hbhpdf\hpdf_encoder.c(2662): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2775): error C2440: '=': cannot convert from 'void *' to 'HPDF_CidRange_Rec *' contrib\hbhpdf\hpdf_encoder.c(2775): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast contrib\hbhpdf\hpdf_encoder.c(2803): error C2440: '=': cannot convert from 'void *' to 'HPDF_CidRange_Rec *' contrib\hbhpdf\hpdf_encoder.c(2803): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
They can be fixed compiling in C mode. But I'm not sure how to force C mode for a single module. Do I have to create one more macro like
CCC_CMD_HBHPDF =$(CC) -wd4244 $(CLIBFLAGS) -Fo$@ $**
? Please confirm.
Sorry I don't understand, The whole of hbhpd.libf (and harupdf.lib) is already compiling with MSVC in C mode, withOUT errors.
So why I get the errors above using MSC32?
Can I fix it or is still a LIVE code?
Enrico,
In the copyright notice of that source its clear its a 3rd pary code and
it has this link:
http://www.winimage.com/zLibDll/minizip.html
It seems to be a live conttrib of zlib:
https://github.com/madler/zlib/tree/master/contrib/minizip
It ssems too much work to create a project specific macro because it
requires adding the macro definition to ALL other compilers. It seems
easier to create a GNERIC CCC_CMD_NOWARN which you then use for the
sources which produce warnings you wantt to silence.
What is MSC32?
Il 23/12/2023 19:11, Enrico Maria Giordano ha scritto:
I would prefer to exclude warning C4244 only for hpdf_utils.c. Is it possible?
And only for MSC.
Il 24/12/2023 17:03, Ron Pinkas ha scritto:
What is MSC32?
MSC32 = Microsoft C++ 32 bit
MSC64 = Microsoft C++ 64 bit
BCC32 = Embarcadero C++ 32 bit
BCC64 = Embarcadero C++ 64 bit
MGW32 = MinGW 32 bit
MGW64 = MinGW 64 bit
Those are the compilers that I have to make xHarbour builds.
Il 24/12/2023 16:53, Ron Pinkas ha scritto:
I would prefer to exclude warning C4244 only for hpdf_utils.c. Is it possible?
And only for MSC.
Yes. You can modify the MACRO used for just this source from CCC_CMD to
new CCC_CMD_NOWARN (assuming CCC_CMD_NOWARN is copy of CCC_CMD with
disable warning)
But it would be a generic macro. Should I create one for each compiler? Otherwise the added switches would have used by all the compilers! Or am
I wrong?
Il 24/12/2023 16:59, Ron Pinkas ha scritto:
Can I fix it or is still a LIVE code?
Enrico,
In the copyright notice of that source its clear its a 3rd pary code and
it has this link:
http://www.winimage.com/zLibDll/minizip.html
It seems to be a live conttrib of zlib:
https://github.com/madler/zlib/tree/master/contrib/minizip
Ok, but how to fix it then? I'm about to give up. This is the warning I
wish to fix:
contrib\hbmzip\unzip.c(1053): warning C4456: declaration of 'uL' hides previous local declaration
I can create a new macro CCC_CMD_MZIP but it would be used by all the compilers. Surely I am missing something...
What is MSC32?
MSC32 = Microsoft C++ 32 bit
MSC64 = Microsoft C++ 64 bit
BCC32 = Embarcadero C++ 32 bit
BCC64 = Embarcadero C++ 64 bit
MGW32 = MinGW 32 bit
MGW64 = MinGW 64 bit
Those are the compilers that I have to make xHarbour builds.
I meant WHICH version?
I tested with VS 2022 using the auto detection
- No user setting required, all auto configured.
Each makefile.bc/dc/gc/pc/vc/wc is where tthe MACRO is defined, so each compiler hass its own definition of tthe macros used by common?.mak
The common make file set tthe generic "formula" and each compiler
specific file provides the compiler specific setting for each generic
MACRO.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 380 |
Nodes: | 16 (2 / 14) |
Uptime: | 48:24:43 |
Calls: | 8,142 |
Calls today: | 5 |
Files: | 13,085 |
Messages: | 5,858,374 |