hello SARG
when building FB with gcc-13+ you get warnings like Warning: found `movsd'; assuming `movsl' was meant
I think that the culprit are the FB_MEMCPY functions defined in FB.h
how would you change those functions in order to get rid of those warnings?
a question for SARG
Re: a question for SARG
Hi srvaldez
Just change movsd by movsl.
It has been done for gfxlib2 (august 2023).
Check in all files if no other cases.
Just change movsd by movsl.
It has been done for gfxlib2 (august 2023).
Check in all files if no other cases.
Re: a question for SARG
thank you SARG
I was not sure that movsd and movsl were equivalent, google didn't help
I was not sure that movsd and movsl were equivalent, google didn't help
Re: a question for SARG
@SARG
2 more warnings that need to be fixed
2 more warnings that need to be fixed
Code: Select all
src/gfxlib2/gfx_bsave.c: In function 'save_bmp':
src/gfxlib2/gfx_bsave.c:138:64: warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
138 | paltmp = (unsigned int *)calloc(sizeof(unsigned int), 256);
| ^~~~~~~~
src/gfxlib2/win32/gfx_driver_d2d.c: In function 'D2DEnumOutputModes':
src/gfxlib2/win32/gfx_driver_d2d.c:829:66: warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
829 | DXGI_MODE_DESC* pModeList = calloc(sizeof(*pModeList), numOutputModes);
| ^
Re: a question for SARG
Replace by something like that : calloc (sizeof (a) + 0, b)
We will not break old code.
What I found :
We will not break old code.
What I found :
-Wcalloc-transposed-args
Warn about calls to allocation functions decorated with attribute alloc_size with two arguments, which use sizeof operator as the earlier size argument and don’t use it as the later size argument. This is a coding style warning. The first argument to calloc is documented to be number of elements in array, while the second argument is size of each element, so calloc (n, sizeof (int)) is preferred over calloc (sizeof (int), n). If sizeof in the earlier argument and not the latter is intentional, the warning can be suppressed by using calloc (sizeof (struct S) + 0, n) or calloc (1 * sizeof (struct S), 4) or using sizeof in the later argument as well.
Re: a question for SARG
that warning doesn't make sense to me, I don't think it's worth the trouble to silence it
thanks SARG for looking into it
thanks SARG for looking into it
Re: a question for SARG
Could you verify that inverting the arguments no warning.
Re: a question for SARG
SARG
yes!, that silenced the warnings
now it builds without a single warning
yes!, that silenced the warnings
now it builds without a single warning