Go Down

Topic: Does gcc for Due Support va_args? (Read 795 times) previous topic - next topic

AdderD

Your code, exactly as you posted it does NOT compile here,  It gives the exact same errors I get with mine - va_list is undefined.

Regards,
Ray L.
It compiles fine for me when targeting the Due. In fact, I've been using these variadic functions in GEVCU for years. It has always compiled perfectly well. You have to have something really messed up with your Arduino installation because it works fine for everyone else. I know that's probably not what you want to hear but it really does compile fine so the problem is on your end.

david_prentice

Well,   I showed you mine.    Perhaps you should say what IDE and what o-s you are using.

When you add the Due package to your IDE,   it will use a specific build of ARM compiler and Arduino core.   Arduino tend to use their own local copies of a Toolset.   And generally,   out of date versions.

I can only think that you and I have different ARM tools.

David.

RayLivingston

Well,   I showed you mine.    Perhaps you should say what IDE and what o-s you are using.

When you add the Due package to your IDE,   it will use a specific build of ARM compiler and Arduino core.   Arduino tend to use their own local copies of a Toolset.   And generally,   out of date versions.

I can only think that you and I have different ARM tools.

David.
I have IDE v1.6.5 installed.  It's been working perfectly for months in every other way - my current application is up to almost 250K of object code.  It clearly is something about my particular install, since it works for you.  However, at least replacing "va_list" with "__gnuc_va_list" compiles and works perfectly.

My compiler is v4.8.3-2014q1.  The SAM3X board support package is v1.6.4, which appears to be the latest version.

Regards,
Ray L.

george4657

My compile of sample program was on Arduino 1.6.5 ide and also in visual micro  , visual studio 213 version in windows 10 64 bit

Checking path to stdarg.h I get:
C:\Users\GEORGE\AppData\Roaming\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\lib\gcc\arm-none-eabi\4.8.3\include\stdarg.h

Check that you have this file

RayLivingston

Yes, I have that file.  If not, it wouldn't be finding definitions for va_start and va_end.

Regards,
Ray L.

westfw

Quote
Build folder: file:///C:/Users/RayL/AppData/Local/V.Micro/Arduino/Builds/SuperATC/arduino_due_x_dbg
Really?  In all this time, with all the questions about your build environment, about verbose compiler output, you didn't think it just might be important to mention that you're using Visual Micro rather than the normal Arduino IDE??!!

(westfw is a bit annoyed.)

It is the IDE part of the Arduino environment that puts together the build commands and decides what the include file paths are going to be.  VM presumably tries to duplicate the internal logic of the IDE (I don't think that there is any readily accessible external file), and it is easy for me to imagine that it gets something wrong.   Since no one else seems to be able to duplicate this problem, I suspect that it IS specific to VM.  Have you tried asking on their forums?  (and this means that if you're describing your environment, you'll have to add which version of VM and VS you're using.  As well as which OS (which you still haven't mentioned.))

FWIW, I spent too many hours last night downloading and installing the latest Visual Studio and Visual Micro to my windows 8 VBox system, and I still couldn't reproduce your problem.


vaclav

#21
Nov 02, 2015, 08:14 pm Last Edit: Nov 02, 2015, 08:15 pm by Vaclav
FYI

Code: [Select]
[code]

# include <stdarg.h>
void setup() {
  // put your setup code here, to run once:

//void ATCStateMachine::DebugMsg(const char *fmt, ...)
//{
//  if (DebugEnable)
//  {
char *fmt;
      char s[256];
      va_list  args;
     
      va_start (args, fmt);
      vsprintf (s, fmt, args);
 //     pCmdQueue->PushDebug(new ATCStringMessage(DebugSrc, DebugDest, s));
      va_end (args);   
//  }

}

void loop() {
  // put your main code here, to run repeatedly:

}
[/code]

Here are errors using 1.6.6 ( nightly build) ARM / Due on XP.
Nothing directly about not being able to use / find  va_list 


Code: [Select]
sketch_nov02b.ino: In function 'void setup()':
sketch_nov02b.ino:14:27: error: 'va_start' used in function with fixed args
'va_start' used in function with fixed args


RayLivingston

Really?  In all this time, with all the questions about your build environment, about verbose compiler output, you didn't think it just might be important to mention that you're using Visual Micro rather than the normal Arduino IDE??!!

(westfw is a bit annoyed.)

It is the IDE part of the Arduino environment that puts together the build commands and decides what the include file paths are going to be.  VM presumably tries to duplicate the internal logic of the IDE (I don't think that there is any readily accessible external file), and it is easy for me to imagine that it gets something wrong.   Since no one else seems to be able to duplicate this problem, I suspect that it IS specific to VM.  Have you tried asking on their forums?  (and this means that if you're describing your environment, you'll have to add which version of VM and VS you're using.  As well as which OS (which you still haven't mentioned.))

FWIW, I spent too many hours last night downloading and installing the latest Visual Studio and Visual Micro to my windows 8 VBox system, and I still couldn't reproduce your problem.


Because it has nothing to do with VisualMicro - I get the same result using the Arduino IDE.  I have NEVER seen one single incompatibility between VisualMicro and the IDE - it USES the IDEs build process.  I've been using it for years and never had a problem that did not manifest identically in the IDE.

Regards,
Ray L.

RayLivingston

FYI

Code: [Select]
[code]

# include <stdarg.h>
void setup() {
  // put your setup code here, to run once:

//void ATCStateMachine::DebugMsg(const char *fmt, ...)
//{
//  if (DebugEnable)
//  {
char *fmt;
      char s[256];
      va_list  args;
     
      va_start (args, fmt);
      vsprintf (s, fmt, args);
 //     pCmdQueue->PushDebug(new ATCStringMessage(DebugSrc, DebugDest, s));
      va_end (args);   
//  }

}

void loop() {
  // put your main code here, to run repeatedly:

}
[/code]

Here are errors using 1.6.6 ( nightly build) ARM / Due on XP.
Nothing directly about not being able to use / find  va_list 


Code: [Select]
sketch_nov02b.ino: In function 'void setup()':
sketch_nov02b.ino:14:27: error: 'va_start' used in function with fixed args
'va_start' used in function with fixed args


You cannot use the va_ macros like that.....

Regards,
Ray L.

vaclav

You cannot use the va_ macros like that.....

Regards,
Ray L.
I was just trying to show you how it behaves on my XP / Due.
I was not trying to write working code.
My point was it does not complain  about undefined va_list, that's all.

Go Up