This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran,patch] Correctly NULL-terminate character constant strings


Fortran strings can contain '\0', so assuming that '\0' is the string
termination character may lead to problems.  Does code, which is not
there for debugging only, depend on NUL-termination of strings?

As far as I have been able to see, '\0' is not assumed to be the string termination character. What is assumed is that value.character.string points to a series of value.character.length+1 bytes, the last one being '\0'.

So, AFAICT, there should be no problem with strings containing '\0'.

FX


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]