identifier "va_list" is undefined in Code Composer Project

89 views Asked by At

I am use TI 8.3.11 (Code Composer Studio) Device Family C6000, SYS/Bios 6.67.3.01

I have a problem with variadic function, which accepts a variable number of arguments. My class:

#include "stdint.h"
#include "stdarg.h"
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Memory.h>
#include <ti/sysbios/heaps/HeapBuf.h>
#include "nexus.hpp"
class Neuron
{
public:
    explicit Neuron() = default;
    ~Neuron();
public:
    void AllocManyNexuses(int count, ...) noexcept;
}

And in cpp i determined it:

void Neuron::AllocManyNexuses(int count, ...) noexcept
{
    const xdc_runtime_IHeap_Handle nexusHandle=reinterpret_cast<xdc_runtime_IHeap_Handle>(heap4KbpNetNexus);
    Error_Block eb;
    Error_init(&eb);
    nexus =reinterpret_cast<Nexus*>(Memory_calloc(nexusHandle, sizeof(Nexus), 0, &eb));


    va_list doubleLists;
    va_start(doubleLists, count);    
    for(int i=0;i<count; ++i)
    {
    and etc
}

My compiler get me some dummy errors:

"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/std.h", line 41: error #20: identifier "va_list" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 118: error #20: identifier "int_least8_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 119: error #20: identifier "uint_least8_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 120: error #20: identifier "int_least16_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 121: error #20: identifier "uint_least16_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 122: error #20: identifier "int_least32_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 123: error #20: identifier "uint_least32_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 126: error #20: identifier "int_least64_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 127: error #20: identifier "uint_least64_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 131: error #20: identifier "int_least40_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 132: error #20: identifier "uint_least40_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 147: error #20: identifier "uint8_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 150: error #20: identifier "uint16_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 153: error #20: identifier "uint32_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 156: error #20: identifier "uint64_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 162: error #20: identifier "intptr_t" is undefined
"C:/ti/bios_6_76_03_01/packages/ti/targets/std.h", line 163: error #20: identifier "uintptr_t" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/std.h", line 196: warning #552-D: variable "u" was set but never used
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 387: error #20: identifier "va_list" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 389: error #20: identifier "va_list" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 396: error #20: identifier "va_list" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 398: error #20: identifier "va_list" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 405: error #20: identifier "va_list" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 407: error #20: identifier "va_list" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 414: error #20: identifier "va_list" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 416: error #20: identifier "va_list" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 443: error #20: identifier "va_list" is undefined
"C:/ti/ccs1220/xdctools_3_62_01_16_core/packages/xdc/runtime/System.h", line 445: error #20: identifier "va_list" is undefined
27 errors detected in the compilation of "../lib/containers/kbpVector.cpp".
gmake: *** [lib/containers/kbpVector.obj] Error 1

What I do wrong, guys?

1

There are 1 answers

0
AudioBubble On
#include <iostream>

template<class ...DOU>
static void product(DOU ...doubles) {
    constexpr int numOfArgs=sizeof...(doubles);
    double arr[numOfArgs]={};
    int index = 0;
    auto setValLamda=[&arr, &index](double i){
        arr[index]= i;
        ++index;
        return i;
    };
    auto supapro = { (setValLamda(doubles),...)};
    for (double val:arr)
    {
        std::cout << val << '\n';
    }
}



int main() {
    product<double>(2.2, 6.2);
    return 0;
}