Enrico, could you fix the errors bellow:
contrib\hbhpdf\hpdf_utils.c:
Warning W8065 contrib\hbhpdf\hpdf_utils.c 219: Call to function 'modff'
with no prototype in function HPDF_FToA
Warning W8065 contrib\hbhpdf\hpdf_utils.c 223: Call to function 'modff'
with no prototype in function HPDF_FToA
Error E2108 contrib\hbhpdf\hpdf_utils.c 235: Improper use of typedef 'HPDF_UINT32' in function HPDF_FToA
Error E2378 contrib\hbhpdf\hpdf_utils.c 235: For statement missing ; in function HPDF_FToA
Error E2451 contrib\hbhpdf\hpdf_utils.c 235: Undefined symbol 'i' in
function HPDF_FToA
Error E2379 contrib\hbhpdf\hpdf_utils.c 235: Statement missing ; in
function HPDF_FToA
Warning W8084 contrib\hbhpdf\hpdf_utils.c 451: Suggest parentheses to
clarify precedence in function HPDF_UInt16Swap
*** 4 errors in Compile ***
2023-12-16 19:00 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
 * source\rtl\zlib\gzread.c
 * contrib\tiff\tif_config.h
 * contrib\tiff\tif_compress.c
   ! fixed compiler warnings
Enrico, could you fix the errors bellow:
contrib\hbhpdf\hpdf_utils.c:
Warning W8065 contrib\hbhpdf\hpdf_utils.c 219: Call to function 'modff'
with no prototype in function HPDF_FToA
Warning W8065 contrib\hbhpdf\hpdf_utils.c 223: Call to function 'modff'
with no prototype in function HPDF_FToA
Error E2108 contrib\hbhpdf\hpdf_utils.c 235: Improper use of typedef 'HPDF_UINT32' in function HPDF_FToA
Error E2378 contrib\hbhpdf\hpdf_utils.c 235: For statement missing ; in function HPDF_FToA
Error E2451 contrib\hbhpdf\hpdf_utils.c 235: Undefined symbol 'i' in
function HPDF_FToA
Error E2379 contrib\hbhpdf\hpdf_utils.c 235: Statement missing ; in
function HPDF_FToA
Warning W8084 contrib\hbhpdf\hpdf_utils.c 451: Suggest parentheses to
clarify precedence in function HPDF_UInt16Swap
*** 4 errors in Compile ***
Enrico, could you fix the errors bellow:
contrib\hbhpdf\hpdf_utils.c:
Warning W8065 contrib\hbhpdf\hpdf_utils.c 219: Call to function
'modff' with no prototype in function HPDF_FToA
Warning W8065 contrib\hbhpdf\hpdf_utils.c 223: Call to function
'modff' with no prototype in function HPDF_FToA
Error E2108 contrib\hbhpdf\hpdf_utils.c 235: Improper use of typedef
'HPDF_UINT32' in function HPDF_FToA
Error E2378 contrib\hbhpdf\hpdf_utils.c 235: For statement missing ;
in function HPDF_FToA
Error E2451 contrib\hbhpdf\hpdf_utils.c 235: Undefined symbol 'i' in
function HPDF_FToA
Error E2379 contrib\hbhpdf\hpdf_utils.c 235: Statement missing ; in
function HPDF_FToA
Warning W8084 contrib\hbhpdf\hpdf_utils.c 451: Suggest parentheses to
clarify precedence in function HPDF_UInt16Swap
*** 4 errors in Compile ***
Try after this commit and let me know:
2023-12-17 11:27 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
Il 16/12/2023 22:35, Reynaldo Henrique ha scritto:
Enrico, could you fix the errors bellow:
contrib\hbhpdf\hpdf_utils.c:
Warning W8065 contrib\hbhpdf\hpdf_utils.c 219: Call to function 'modff' with no prototype in function HPDF_FToA
Warning W8065 contrib\hbhpdf\hpdf_utils.c 223: Call to function 'modff' with no prototype in function HPDF_FToA
Error E2108 contrib\hbhpdf\hpdf_utils.c 235: Improper use of typedef 'HPDF_UINT32' in function HPDF_FToA
Error E2378 contrib\hbhpdf\hpdf_utils.c 235: For statement missing ; in function HPDF_FToA
Error E2451 contrib\hbhpdf\hpdf_utils.c 235: Undefined symbol 'i' in function HPDF_FToA
Error E2379 contrib\hbhpdf\hpdf_utils.c 235: Statement missing ; in function HPDF_FToA
Warning W8084 contrib\hbhpdf\hpdf_utils.c 451: Suggest parentheses to clarify precedence in function HPDF_UInt16Swap
*** 4 errors in Compile ***
Try after this commit and let me know:
2023-12-17 11:27 UTC+0100 Enrico Maria Giordano <e.m.giordano@emagsoftware.it>
Many thanks Enrico. This code is copied from a 3rd party (https://github.com/libharu/libharu) so we should be very careful with making any modifications - on the system I tested (AL2023) it compiled without any issue. Which compiler had a problem withthe code?
I strongly suggest reviewing these changes and considering a sollution that avoid changess these sources directlly. Or else if we are sure the code is wrong we should instead report and suggest fixes to the original project.
Sorry, BCC32 and BCC64. They doesn't have modff(), only modf(). The
other changes are merely casts.
Many thanks Enrico. This code is copied from a 3rd party
(https://github.com/libharu/libharu) so we should be very careful with
making any modifications - on the system I tested (AL2023) it compiled
without any issue. Which compiler had a problem with the code?
MSC
Warning W8065 contrib\hbhpdf\hpdf_utils.c 219: Call to function 'modff'
with no prototype in function HPDF_FToA
Warning W8065 contrib\hbhpdf\hpdf_utils.c 223: Call to function 'modff'
with no prototype in function HPDF_FToA
Ok, I stopped fixing the warnings for now, but the two above are errors because BCC32 does not have the function modff in any of its libraries.
Warning W8065 contrib\hbhpdf\hpdf_utils.c 219: Call to function 'modff'
with no prototype in function HPDF_FToA
Warning W8065 contrib\hbhpdf\hpdf_utils.c 223: Call to function 'modff'
with no prototype in function HPDF_FToA
Ok, I stopped fixing the warnings for now, but the two above are errors because BCC32 does not have the function modff in any of its libraries.
This is the declarations of the two functions modf() and modff():
double modf( double x, double * intptr );
float modff( float x, float * intptr );
I'm dumb as far as this goes, but can you define modff() in your compiler script to point to modf(), just for BCC32? He wants to avoid altering the code, so...
Il 19/12/2023 13:58, Dlzc ha scritto:
This is the declarations of the two functions modf() and modff():
double modf( double x, double * intptr );
float modff( float x, float * intptr );
I'm dumb as far as this goes, but can you define modff() in your compiler script to point to modf(), just for BCC32? He wants to avoid altering the code, so...
What do you mean with "compiler script"?
Il 19/12/2023 12:44, Enrico Maria Giordano ha scritto:
Warning W8065 contrib\hbhpdf\hpdf_utils.c 219: Call to function 'modff' with no prototype in function HPDF_FToA
Warning W8065 contrib\hbhpdf\hpdf_utils.c 223: Call to function 'modff' with no prototype in function HPDF_FToA
Ok, I stopped fixing the warnings for now, but the two above are errors because BCC32 does not have the function modff in any of its libraries.
Do I have to revert my changes to hbhpdf directory?
Enrico look at include/hbdefs.h
Il 19/12/2023 16:29, Ron Pinkas ha scritto:
Enrico look at include/hbdefs.h
Ok, are there special requirements or I can just add the new code at the
end (before #endif /* HB_DEFS_H_ */, of course)?
Do I have to revert my changes to hbhpdf directory?
Yes we should revert, but it may be easier to simply copy again the unmodified soources from the original project, its basically all
include/*.h and src/*.c from:
https://github.com/libharu/libharu
Ok, are there special requirements or I can just add the new code at the
end (before #endif /* HB_DEFS_H_ */, of course)?
You can ADD the needed new defines at the end of the respective compiler section, following the example of existing code.
Il 19/12/2023 17:01, Ron Pinkas ha scritto:
Ok, are there special requirements or I can just add the new code at the end (before #endif /* HB_DEFS_H_ */, of course)?
You can ADD the needed new defines at the end of the respective compiler section, following the example of existing code.
How long you don't read that file? :-) There is nothing similar to a "section" in there. Please have a look at it and tell me where I have to
put the new function definition for BCC32.
How long you don't read that file? :-) There is nothing similar to a
"section" in there. Please have a look at it and tell me where I have to
put the new function definition for BCC32.
Enrico,
Here is an example of a "compiler secttion":
#if defined( _MSC_VER )
# if defined( _MSC_VER ) && _MSC_VER >= 1400
# include <intrin.h>
# endif
#undef HAVE_INTTYPES_H
#define HAVE_INTTYPES_H 0
#if ( _MSC_VER >= 1600 )
#undef HAVE_STDINT_H
#define HAVE_STDINT_H 1
#else
#undef HAVE_STDINT_H
#define HAVE_STDINT_H 0
#if ( _MSC_VER > 1400 )
#define HAVE_INTSAFE_H 1
#endif
#endif
#else
Il 19/12/2023 20:24, Ron Pinkas ha scritto:
How long you don't read that file? :-) There is nothing similar to a "section" in there. Please have a look at it and tell me where I have to put the new function definition for BCC32.
Enrico,
Here is an example of a "compiler secttion":
#if defined( _MSC_VER )
# if defined( _MSC_VER ) && _MSC_VER >= 1400
# include <intrin.h>
# endif
#undef HAVE_INTTYPES_H
#define HAVE_INTTYPES_H 0
#if ( _MSC_VER >= 1600 )
#undef HAVE_STDINT_H
#define HAVE_STDINT_H 1
#else
#undef HAVE_STDINT_H
#define HAVE_STDINT_H 0
#if ( _MSC_VER > 1400 )
#define HAVE_INTSAFE_H 1
#endif
#endif
#else
Yes, but there are many of them scattered through the file. So, I ask
again: can I add the new code at the end of the file? I took for granted
the use of #ifdef. Please confirm.
Yes, but there are many of them scattered through the file. So, I ask
again: can I add the new code at the end of the file? I took for granted
the use of #ifdef. Please confirm.
MY preference is for ALL rulles related to a given compiler to be in
just ONE secxtion except when broken placement order is required due to reliance on other code, bu in general yes, adding a section at the end
is valid.
In the specific case of libharu we might not be able to use this
approach if given compilation unit does NOT #include our core #includes.
Il 19/12/2023 21:40, Ron Pinkas ha scritto:
Yes, but there are many of them scattered through the file. So, I ask again: can I add the new code at the end of the file? I took for granted the use of #ifdef. Please confirm.
MY preference is for ALL rulles related to a given compiler to be in
just ONE secxtion except when broken placement order is required due to reliance on other code, bu in general yes, adding a section at the end
is valid.
In the specific case of libharu we might not be able to use this
approach if given compilation unit does NOT #include our core #includes.
Right! OK, option cancelled. Can't we just define the missing modff() function in one of the rtl modules, guarded by #ifdef __BORLANDC__ etc.?
Right! OK, option cancelled. Can't we just define the missing modff()
function in one of the rtl modules, guarded by #ifdef __BORLANDC__ etc.?
I am currently working on trying to fix MSVC, later we can review BCC
and others.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (2 / 14) |
Uptime: | 66:57:16 |
Calls: | 8,355 |
Calls today: | 15 |
Files: | 13,159 |
Messages: | 5,894,221 |
Posted today: | 1 |