warning al construir harbour con mingw32 y 64

72 views
Skip to first unread message

carloskds

unread,
Nov 20, 2025, 5:51:39 PM (8 days ago) Nov 20
to Harbour Developers
2025-11-19 17_34_55-Greenshot.png
Este warning aparece al construir harbour con mingw32 y 64 bit.

ademas en mingw64 bit, aparecen un sinnumero de warning al compilar gencc.c 

reporto para que se revise.

salu2
carlos vargas

Aleksander Czajczynski

unread,
Nov 21, 2025, 5:17:39 AM (7 days ago) Nov 21
to harbou...@googlegroups.com
Hello!

It is visible in GitHub's windows-ci for some time.

In file included from ../../../hvmall.c:105:
../../../macro.c: In function 'hb_macroTextSymbol':
../../../macro.c:748:38: error: 'memcpy' specified bound 4294967295 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=]
748 | szResult = ( char * ) memcpy( hb_xgrab( nLength + 1 ),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
749 | szString, nLength );
| ~~~~~~~~~~~~~~~~~~~

It seems that on Windows GCC now has other artificial limit for strings than it does for other platforms. What should we do, create another artificial limiter value in the codebase? It's obvious that the code will never create such long values. IMHO I'd live on with such warning, but what's a sensible solution for strict mode here?

Best regards, Aleksander

carloskds wrote:
--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-devel/fe0e7dce-17de-4b37-8f87-f61094714632n%40googlegroups.com.

Phil Krylov

unread,
Nov 21, 2025, 1:16:31 PM (7 days ago) Nov 21
to harbou...@googlegroups.com
Hi,

On Fri, 21 Nov 2025 at 11:17, Aleksander Czajczynski <h...@fki.pl> wrote:
../../../macro.c:748:38: error: 'memcpy' specified bound 4294967295 exceeds maximum object size 2147483647 [-Werror=stringop-overflow=]
748 | szResult = ( char * ) memcpy( hb_xgrab( nLength + 1 ),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
749 | szString, nLength );
| ~~~~~~~~~~~~~~~~~~~

I usually see this warning when a signed int is passed to malloc()/calloc(). Casting to `unsigned` makes the warning go away.
 
-- Ph.
Reply all
Reply to author
Forward
0 new messages