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



Hi,


François-Xavier Coudert <fxcoudert@gmail.com> wrote on Tue, 31 Oct 2006:
Attached patch corrects a few functions which did not correctly
NULL-terminate value.character.string for CHARACTER constants.
Although it appears that this NULL-termination was not required when
the front-end was first written, a few places now rely on it, and I
don't think it's too bad to accomodate them. I've tried to review and
fix not only the problem in the original PR, but all other such
places.

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?


- Tobi

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



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