https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66367

            Bug ID: 66367
           Summary: Objective-C Variadic Method Not Working
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chrisloonam at gmail dot com
  Target Milestone: ---

Created attachment 35671
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35671&action=edit
The source file that is generating the error, pre-compiled with gcc -save-temps

This error is being experienced on GCC 5.1.0 on an Arch Linux system. 

When making a variadic method like the following

    - (void)method:(id)o, ...
    {
        int c = 1;
        va_list list;
        va_start(list, o);
        while (va_arg(list, id))
            c++;
        va_end(list);
    }
the compiler reports the following error

    error: expected expression before ‘id’
If `id` is replaced with `void *`, the same error occurs.

Attached is the pre-compiled source of the file where you can find this code.
The file succssfully compiles in clang, leading me to believe that this is in
fact a bug and not a programmer error.

Reply via email to