Skip to contentSkip to conversation

PATCH: build gcc/gcc/depedence.c w/HPUX ANSI C

parisc-linux Grant Grundler 2 participants 2 messages Sep 1, 2000

lore
Share & tools
lore
#0 lore raw

Hi folks,
I work on the parisc-linux port and was trying to build binutils/gcc on an HP-UX 11 system. HP-UX ansic didn't like enum direction_type[][] or int[][] constructs. It complained with:
cc: "/linux/pa32/gcc/gcc/dependence.c", line 199: error 1501: Only the first
dimension of an array may be omitted.

I've been told GCC refuses to compile the same thing with:
x.c:1: warning: array i' assumed to have one element x.c:1: storage size of i' isn't known

This is probably not exactly the right fix but at least I can build a binary now. I haven't tested the resulting binary.

thanks,
grant

grundler <815>cvs diff gcc/gcc/dependence.c
Index: gcc/gcc/dependence.c
===================================================================
RCS file: /home/cvs/parisc/gcc/gcc/dependence.c,v
retrieving revision 1.1

08/31 23:44:27 renamed from 08/22 20:56:22 1.1 +7 -7
diff -u -p -r1.1 dependence.c
@@ -196,15 +196,15 @@ static int get_one_coefficient PARAMS ((
 static void normalize_coefficients PARAMS ((subscript[], loop*, int));
 static void classify_dependence PARAMS ((subscript[], subscript[],
                                 enum complexity_type[], int*, int));
-static void ziv_test PARAMS ((subscript[], subscript[], enum direction_type[][],
-                     int[][], loop*, int));
-static void siv_test PARAMS ((subscript[], subscript[], enum direction_type[][],
-                     int[][], loop*, int));
+static void ziv_test PARAMS ((subscript[], subscript[], enum direction_type[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS],
+                     int[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS], loop*, int));
+static void siv_test PARAMS ((subscript[], subscript[], enum direction_type[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS],
+                     int[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS], loop*, int));
 static int check_subscript_induction PARAMS ((subscript*, subscript*, loop*));
-static void gcd_test PARAMS ((subscript[], subscript[], enum direction_type[][],
-                     int[][], loop*, int));
+static void gcd_test PARAMS ((subscript[], subscript[], enum direction_type[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS],
+                     int[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS], loop*, int));
 static int find_gcd PARAMS ((int, int));
-static void merge_dependencies PARAMS ((enum direction_type[][], int[][], int, int));
+static void merge_dependencies PARAMS ((enum direction_type[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS], int[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS], int, int));
 static void dump_array_ref PARAMS ((tree));
 static void dump_one_node PARAMS ((def_use*, varray_type*));
 static void dump_node_dependence PARAMS ((void));
#1 lore raw
Quoted 6 lines

Hi folks,
I work on the parisc-linux port and was trying to build binutils/gcc on an HP-UX 11 system. HP-UX ansic didn't like enum direction_type[][] or int[][] constructs. It complained with:
cc: "/linux/pa32/gcc/gcc/dependence.c", line 199: error 1501: Only the first
dimension of an array may be omitted.

I believe this was recently fixed in the mainline source:

2000-08-23 Alexandre Oliva <[email protected]>

* dependence.c: Replace [][]' with [][MAX_SUBSCRIPTS]'.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)