ngs-lang / ngs

Next Generation Shell (NGS)
https://ngs-lang.org/
GNU General Public License v3.0
1.49k stars 41 forks source link

malloc.c:71:1: warning: non-void function does not return a value in all control paths [-Wreturn-type] #663

Closed ryandesign closed 4 months ago

ryandesign commented 5 months ago

Building ngs 0.2.16 I see this warning:

malloc.c:71:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
1 warning generated.
ilyash-b commented 5 months ago

Which platform and compiler?

One of the control paths in ngs_realloc() ends with assert(0 == "Realloc not implemented for NGS_STD_MALLOC_AFTER_FORK"). I can try to fix the warning when I'll be able to reproduce it. I don't see this issue on my machine and several outputs of GH actions that I looked at.

ryandesign commented 5 months ago

macOS, clang

ilyash-b commented 4 months ago

I think we can ignore this. Apple clang version 15.0.0 (clang-1500.3.9.4) knows how to handle this. I can reproduce the issue when I comment out the assert() that always fails. It seems that version 15 is smart enough to figure this out and you are using some earlier version that doesn't. Closing. If you consider this issue to be critical, please reopen.