Are nested functions a bad thing in gcc ? [closed]

Nested functions really don’t do anything that you can’t do with non-nested ones (which is why neither C nor C++ provide them). You say you are not interested in other compilers – well this may be atrue at this moment, but who knows what the future will bring? I would avoid them, along with all other GCC “enhancements”.

A small story to illustrate this – I used to work for a UK Polytechinc which mostly used DEC boxes – specifically a DEC-10 and some VAXen. All the engineering faculty used the many DEC extensions to FORTRAN in their code – they were certain that we would remain a DEC shop forever. And then we replaced the DEC-10 with an IBM mainframe, the FORTRAN compiler of which didn’t support any of the extensions. There was much wailing and gnashing of teeth on that day, I can tell you. My own FORTRAN code (an 8080 simulator) ported over to the IBM in a couple of hours (almost all taken up with learning how to drive the IBM compiler), because I had written it in bog-standard FORTRAN-77.

Leave a Comment