This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [patch, fortran] PR66310 Problems with intrinsic repeat for large number of copies


On 07/12/2016 06:54 PM, William Clodius wrote:
A minor question. Why with Fortran’s counted strings are you appending a null character?


gfortran is written in C. We NULL terminate some strings for convenience during compilation and sometimes as a precaution. One example where it is helpful is when using the gdb debugger to debug the actual compiler and you want to print values stored at addresses. It avoids garbage while looking at it. Also during compilation we may want to scan or search a string using a for loop that terminates on the NULL.

As far as Fortran is concerned, its not there. And in the case of this bug I could choose to eliminate it, I'm just being conservative in case it is used somewhere I am not aware of.

Jerry




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