https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71218
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org --- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> --- Rather than warning for benign but inefficient code I'd find it more friendly if GCC optimized it instead (if possible of course). In this case, it should be possible to rewrite it as suggested (i.e., turn dynamic allocation into automatic). A warning would then be useful if the automatic rewrite wasn't possible for some reason. Conversely, it could also turn stack allocation into dynamic for very large sizes (under some option controlling the cut-off point). This would be especially useful for VLAs.