This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Version issues

I am an engineer working with a device from a company that makes flame sensing equipment. I won't bore you with the why and the what but basically the device comes with a bare bones μVision 5 project to construct the API and get you started. I'm more an engineer who can code than a programmer and I'm struggling. The API files are a few years old, the company said they won't update them anytime soon and I'm having trouble porting it to version 6 of the compiler. It was made for version 5. I think I've fixed most of the errors but there is one that I just can't seem to get.

Its a 'Too many arguments to function call - single argument function has six arguments '

I'm assuming that these files work just fine on the correct compiler version. I've fixed all the other errors by finding out the changes in syntax between version 5 and 6 but I can't find anything like that on this error. Can someone tell me if there is something obvious I'm missing. The actual code is on another computer and I don't have it handy at the moment, but I can provide it later if the issue isn't obvious from my description.

Thanks

Parents
  • Hello again,

    Apologies, I misunderstood the context of your query... if you wish to use Arm Compiler 5, then my original answer shows you how to do it.

    For the cause of the error, I'm not sure if your original project was built for a particular C standard, but I generates the equivalent (expected) error with both armcc and armclang.

    extern int bar(int a);
    
    int foo(){
    	return bar(1, 2, 3, 4, 5, 6);
    }
    

    armcc -c foo.c
    "foo.c", line 4: Error:  #140: too many arguments in function call
    
    
    armclang -c foo.c --target=arm-arm-none-eabi -mcpu=cortex-m3 -std=c90
    foo.c:4:16: error: too many arguments to function call, expected single argument 'a', have 6 arguments

    Note the default standard for armcc is c90, but for armclang it is c11, however using armclang -std=c90 (and others) also fails.
    https://developer.arm.com/documentation/100068/0620/Migrating-from-Arm-Compiler-5-to-Arm-Compiler-for-Embedded-6/Default-differences

    Could you share your code example, and armcc build options?

Reply
  • Hello again,

    Apologies, I misunderstood the context of your query... if you wish to use Arm Compiler 5, then my original answer shows you how to do it.

    For the cause of the error, I'm not sure if your original project was built for a particular C standard, but I generates the equivalent (expected) error with both armcc and armclang.

    extern int bar(int a);
    
    int foo(){
    	return bar(1, 2, 3, 4, 5, 6);
    }
    

    armcc -c foo.c
    "foo.c", line 4: Error:  #140: too many arguments in function call
    
    
    armclang -c foo.c --target=arm-arm-none-eabi -mcpu=cortex-m3 -std=c90
    foo.c:4:16: error: too many arguments to function call, expected single argument 'a', have 6 arguments

    Note the default standard for armcc is c90, but for armclang it is c11, however using armclang -std=c90 (and others) also fails.
    https://developer.arm.com/documentation/100068/0620/Migrating-from-Arm-Compiler-5-to-Arm-Compiler-for-Embedded-6/Default-differences

    Could you share your code example, and armcc build options?

Children