This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] Add comments about strlen
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 31 Aug 2004 00:29:01 +0100
- Subject: [gfortran] Add comments about strlen
- Organization: CodeSourcery
The patch below adds a comment describing gfc_strlen_type_node, as pointed out
be RTH.
It also removes a could of unused #defines left over from when we did builtin
functions differently.
Tested on i686-linux.
Applied to mainline.
Paul
2004-08-31 Paul Brook <paul@codesourcery.com>
* trans-types.h: Add comments.
(intmax_type_node, string_type_node, const_string_type_node): Remove.
libgfortran/
* libgfortran.h: Add comments.
Index: gcc/fortran/trans-types.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/trans-types.h,v
retrieving revision 1.6
diff -u -p -r1.6 trans-types.h
--- gcc/fortran/trans-types.h 30 Aug 2004 21:59:08 -0000 1.6
+++ gcc/fortran/trans-types.h 30 Aug 2004 23:20:38 -0000
@@ -45,15 +45,13 @@ extern GTY(()) tree gfc_character1_type_
extern GTY(()) tree ppvoid_type_node;
extern GTY(()) tree pvoid_type_node;
extern GTY(()) tree pchar_type_node;
+/* This is the type used to hold string lengths. It has nothing to do with
+ the C strlen(3) function. It must be the same as the corresponding
+ definition in gfortran.h. */
+/* TODO: This is still hardcoded as kind=4 in some bits of the compiler
+ and runtime library. */
extern GTY(()) tree gfc_strlen_type_node;
-/* These C-specific types are used while building builtin function decls.
- For now it doesn't really matter what these are defined to as we don't
- need any of the builtins that use them. */
-#define intmax_type_node gfc_int8_type_node
-#define string_type_node pchar_type_node
-#define const_string_type_node pchar_type_node
-
/* be-function.c */
void gfc_convert_function_code (gfc_namespace *);
Index: libgfortran/libgfortran.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libgfortran/libgfortran.h,v
retrieving revision 1.10
diff -u -p -r1.10 libgfortran.h
--- libgfortran/libgfortran.h 28 Aug 2004 19:48:02 -0000 1.10
+++ libgfortran/libgfortran.h 30 Aug 2004 22:49:15 -0000
@@ -87,7 +87,11 @@ typedef double GFC_REAL_8;
typedef complex float GFC_COMPLEX_4;
typedef complex double GFC_COMPLEX_8;
+/* The following two definitions must be consistent with the types used
+ by the compiler. */
+/* The type used of array indices, amongst other things. */
typedef size_t index_type;
+/* The type used for string lengths. Nothing to do with strlen(3). */
typedef GFC_INTEGER_4 gfc_strlen_type;
/* This will be 0 on little-endian machines and one on big-endian machines.
*/