Imported Upstream version 7.9
[platform/upstream/gdb.git] / gdb / testsuite / gdb.base / setvar.c
index 83509cd..1b8d808 100644 (file)
@@ -1,13 +1,6 @@
 #include <stdlib.h>
 
-#ifdef PROTOTYPES
 int main (int argc, char **argv, char **envp)
-#else
-main (argc, argv, envp)
-     int argc;
-     char **argv;
-     char **envp;
-#endif
 {
     extern void dummy();
     dummy();
@@ -115,6 +108,13 @@ struct {
     double     v_double_member;
 } v_struct2;
 
+struct
+{
+  long v_long_member;
+  struct t_struct t;
+  char v_char_member;
+} v_struct3;
+
 /**** unions *******/
 
 union t_union {
@@ -197,7 +197,7 @@ dummy ()
 {
   /* setvar.exp wants to allocate memory for constants.  So make sure malloc
      gets linked into the program.  */
-  malloc (1);
+  void *p = malloc (1);
 
   /* Some linkers (e.g. on AIX) remove unreferenced variables,
      so make sure to reference them. */
@@ -271,4 +271,5 @@ dummy ()
   sef.field = s1;
   uef.field = u1;
 #endif
+  free (p);
 }