* c-exp.y (DOTDOTDOT): New token.
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index bcc2edf70e6fac62153800ab7608a2ff76121ffa..cb25e71fc7c5c5d02727290ea4196b70573176b2 100644 (file)
@@ -463,7 +463,8 @@ lookup_function_type (struct type *type)
 }
 
 /* Given a type TYPE and argument types, return the appropriate
-   function type.  */
+   function type.  If the final type in PARAM_TYPES is NULL, make a
+   varargs function.  */
 
 struct type *
 lookup_function_type_with_arguments (struct type *type,
@@ -473,6 +474,12 @@ lookup_function_type_with_arguments (struct type *type,
   struct type *fn = make_function_type (type, (struct type **) 0);
   int i;
 
+  if (nparams > 0 && param_types[nparams - 1] == NULL)
+    {
+      --nparams;
+      TYPE_VARARGS (fn) = 1;
+    }
+
   TYPE_NFIELDS (fn) = nparams;
   TYPE_FIELDS (fn) = TYPE_ZALLOC (fn, nparams * sizeof (struct field));
   for (i = 0; i < nparams; ++i)
This page took 0.024868 seconds and 4 git commands to generate.