In our Fortran software, debug parameters can be passed using environment variables with a pattern PREFIX_KEY. I want to perform a check, whether the given KEY exists in order to guard against typos.
I know about GET_ENVIRONMENT_VARIABLE (Fortran 2003), and this is what the code uses for querying the variables. Is there also a portable manner of enumerating all environment variables, so I can check them for unexpected PREFIX_KEY variables?
The software is running in both Linux and Windows environments, and built with different compilers for both platform support and code verification. Portability is thus a big concern.