Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
What is the portability of malloc(0);? Which platforms return NULL without setting errno? Which platforms return a non-null pointer? Do any platforms have some other behavior?
#2: Post edited
Which platforms return a non-null pointer on malloc(0)
Hi,I'm interested in the portability of `malloc(0);`.- - Which platforms return `NULL` without setting `errno`?
- - Which platforms return a non-null pointer?
- Do any platforms have a behavior that I didn't list?I'm especially interested in POSIX platforms, but I'd also appreciate information about non-POSIX ones.
- What is the portability of `malloc(0);`?
- - Which platforms return `NULL` without setting `errno`?
- - Which platforms return a non-null pointer?
- - Do any platforms have some other behavior?
#1: Initial revision
Which platforms return a non-null pointer on malloc(0)
Hi, I'm interested in the portability of `malloc(0);`. - Which platforms return `NULL` without setting `errno`? - Which platforms return a non-null pointer? - Do any platforms have a behavior that I didn't list? I'm especially interested in POSIX platforms, but I'd also appreciate information about non-POSIX ones.