On Wednesday 29 October 2025 21:58:12 Peter0x44 wrote:
> On 2025-10-29 21:49, Pali Rohár wrote:
> > On Wednesday 29 October 2025 20:48:15 Peter0x44 wrote:
> > > Oct 29, 2025 8:46:48 PM Pali Rohár <[email protected]>:
> > > 
> > > > Hello, the new memalignment function is causing a new compile warning:
> > > >
> > > > misc/memalignment.c:9:8: warning: no previous prototype for 
> > > > ‘memalignment’ [-Wmissing-prototypes]
> > > > size_t memalignment(const void *p)
> > > >         ^~~~~~~~~~~~
> > > >
> > > > Seems that the reason is that __STDC_VERSION__ is not set to 202311L and
> > > > so stdlib.h does not provide the prototype.
> > > >
> > > > I would suggest to add "|| defined(_CRTBLD)" into stdlib.h for
> > > > memalignment() guard, to mingw-w64 runtime can use memalignment.
> > > 
> > > Oh, I see. I think I didn't notice because I'm using gcc 15 and it
> > > defaults to -std=c23.
> > > What compiler are you using?
> > 
> > Sorry, I have not mentioned it, this particular warning was cause by old
> > gcc 8.3.
> 
> How about simply removing the include of stdlib.h and adding the prototype
> manually?
> 
> __SIZE_T__ memalignment(const void* p);

That is fine too. You can include corecrt.h or stddef.h which provides size_t 
keyword.


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to