Hi there,
Due to RTOS constraint, code like [ dbg_LogMsg(1,"ERR."__FUNCTION__); ] is used a lot with CGT4.9.1.
CGT5.1 reports : error #18: expected a ")"
What's the replacement ?
Thanks!
Yulin.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I'm not really sure what is going on. Please build again with the options --gen_acp_raw --verbose_diagnostics. The option --gen_acp_raw causes the compiler to create a file named source_file_name.rl which contains your source before and after preprocessing. Please show the .rl file lines related to this one. The option --verbose_diagnostics causes the compiler to issue a more verbose form of the diagnostic that echoes the problem source line with a ^ character pointing to where in the line the problem begins. Please show that diagnostic.
Thanks and regards,
-George
Archaeologist,
"C:/ti/ccsv6/tools/compiler/arm_5.1.6/bin/armcl" -mv5e --code_state=32 --abi=ti_arm9_abi -me -O2 -g --include_path="C:/ti/ccsv6/tools/compiler/arm_5.1.6/include" --gcc --define="_DEBUG" --diag_warning=225 --diag_error=225 --display_error_number --printf_support=nofloat --std_lib_func_redefined --preproc_with_compile --preproc_dependency="test.pp" "D:/prj/mtg_ccs6/shl/cvr730/test.c"
"D:/prj/mtg_ccs6/shl/cvr730/test.c", line 11: error #18: expected a ")"
Regards,
Yulin.
George,
L 1 "D:/prj/mtg_ccs6/shl/cvr730/test.c" N#include <stdio.h> L 1 "C:/ti/ccsv6/tools/compiler/arm_5.1.6/include/stdio.h" 1 N/*****************************************************************************/ N/* STDIO.H v5.1.6 */ N/* */ N/* Copyright (c) 1993-2014 Texas Instruments Incorporated */ N/* http://www.ti.com/ */ N/* */ N/* Redistribution and use in source and binary forms, with or without */ N/* modification, are permitted provided that the following conditions */ N/* are met: */ N/* */ N/* Redistributions of source code must retain the above copyright */ N/* notice, this list of conditions and the following disclaimer. */ N/* */ N/* Redistributions in binary form must reproduce the above copyright */ N/* notice, this list of conditions and the following disclaimer in */ N/* the documentation and/or other materials provided with the */ N/* distribution. */ N/* */ N/* Neither the name of Texas Instruments Incorporated nor the names */ N/* of its contributors may be used to endorse or promote products */ N/* derived from this software without specific prior written */ N/* permission. */ N/* */ N/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ N/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ N/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ N/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ N/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ N/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ N/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ N/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ N/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ N/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ N/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ N/* */ N/*****************************************************************************/ N#ifndef _STDIO N#define _STDIO N N N#include <linkage.h> L 1 "C:/ti/ccsv6/tools/compiler/arm_5.1.6/include/linkage.h" 1 N/*****************************************************************************/ N/* linkage.h v5.1.6 */ N/* */ N/* Copyright (c) 1998-2014 Texas Instruments Incorporated */ N/* http://www.ti.com/ */ N/* */ N/* Redistribution and use in source and binary forms, with or without */ N/* modification, are permitted provided that the following conditions */ N/* are met: */ N/* */ N/* Redistributions of source code must retain the above copyright */ N/* notice, this list of conditions and the following disclaimer. */ N/* */ N/* Redistributions in binary form must reproduce the above copyright */ N/* notice, this list of conditions and the following disclaimer in */ N/* the documentation and/or other materials provided with the */ N/* distribution. */ N/* */ N/* Neither the name of Texas Instruments Incorporated nor the names */ N/* of its contributors may be used to endorse or promote products */ N/* derived from this software without specific prior written */ N/* permission. */ N/* */ N/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ N/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ N/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ N/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ N/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ N/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ N/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ N/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ N/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ N/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ N/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ N/* */ N/*****************************************************************************/ N N#ifndef _LINKAGE N#define _LINKAGE N N/* No modifiers are needed to access code or data */ N N#define _CODE_ACCESS N#define _DATA_ACCESS N#define _DATA_ACCESS_NEAR N N/*--------------------------------------------------------------------------*/ N/* Define _IDECL ==> how inline functions are declared */ N/*--------------------------------------------------------------------------*/ N#ifdef _INLINE N#define _IDECL static __inline N#define _IDEFN static __inline N#define __INLINE static __inline N#else S#define _IDECL extern _CODE_ACCESS S#define _IDEFN _CODE_ACCESS S#define __INLINE __EXTERN N#endif N N#endif /* ifndef _LINKAGE */ L 42 "C:/ti/ccsv6/tools/compiler/arm_5.1.6/include/stdio.h" 2 N#include <stdarg.h> L 1 "C:/ti/ccsv6/tools/compiler/arm_5.1.6/include/stdarg.h" 1 N/*****************************************************************************/ N/* stdarg.h v5.1.6 */ N/* */ N/* Copyright (c) 1996-2014 Texas Instruments Incorporated */ N/* http://www.ti.com/ */ N/* */ N/* Redistribution and use in source and binary forms, with or without */ N/* modification, are permitted provided that the following conditions */ N/* are met: */ N/* */ N/* Redistributions of source code must retain the above copyright */ N/* notice, this list of conditions and the following disclaimer. */ N/* */ N/* Redistributions in binary form must reproduce the above copyright */ N/* notice, this list of conditions and the following disclaimer in */ N/* the documentation and/or other materials provided with the */ N/* distribution. */ N/* */ N/* Neither the name of Texas Instruments Incorporated nor the names */ N/* of its contributors may be used to endorse or promote products */ N/* derived from this software without specific prior written */ N/* permission. */ N/* */ N/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ N/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ N/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */ N/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ N/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */ N/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ N/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */ N/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */ N/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */ N/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ N/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ N/* */ N/*****************************************************************************/ N N#ifndef _STDARG N#define _STDARG N N#ifdef __cplusplus S#define _NS_PREFIX std:: Snamespace std { N#else N#define _NS_PREFIX N#endif /* __cplusplus */ N N#ifdef __TI_EABI_SUPPORT__ Stypedef struct __va_list { S void * __ap; S} va_list; N#else Ntypedef char *va_list; N#endif N N#ifdef __cplusplus S} /* namespace std */ N#endif N N#define _VA_RNDUP(sz) (((sz) + 3) & ~3) N#define _VA_MASK(tp) ((__ALIGNOF__(tp) == 8) ? 7 : 3) N#define _VA_ALN(ap,tp) (((int)(ap) + _VA_MASK(tp)) & ~(_VA_MASK(tp))) N N#ifdef __TI_EABI_SUPPORT__ S#define va_start(ap, parmN) \ S ((ap).__ap = ((void *)((((int)__va_parmadr(parmN))&~3) + \ S _VA_RNDUP(sizeof(parmN))))) X#define va_start(ap, parmN) ((ap).__ap = ((void *)((((int)__va_parmadr(parmN))&~3) + _VA_RNDUP(sizeof(parmN))))) N#else N#define va_start(ap, parmN) \ N ((ap) = (__va_argref(parmN) \ N ? (_NS_PREFIX va_list)((int)__va_parmadr(parmN) + 4 ) \ N : (sizeof(parmN) < sizeof(int)) \ N ? (_NS_PREFIX va_list)((int)__va_parmadr(parmN) + 4 & ~3) \ N : (_NS_PREFIX va_list)((int)__va_parmadr(parmN) + sizeof(parmN)))) X#define va_start(ap, parmN) ((ap) = (__va_argref(parmN) ? (_NS_PREFIX va_list)((int)__va_parmadr(parmN) + 4 ) : (sizeof(parmN) < sizeof(int)) ? (_NS_PREFIX va_list)((int)__va_parmadr(parmN) + 4 & ~3) : (_NS_PREFIX va_list)((int)__va_parmadr(parmN) + sizeof(parmN)))) N#endif N N#ifdef __big_endian__ S#ifdef __TI_EABI_SUPPORT__ S#define va_arg(_ap, _type) \ S (((_ap).__ap = (void*)(_VA_ALN((_ap).__ap, _type) + \ S _VA_RNDUP(sizeof(_type)))), \ S (*(_type *)((int)(_ap).__ap - \ S (__va_argcsu(_type) ? _VA_RNDUP(sizeof(_type)) \ S : (sizeof(_type)))))) X#define va_arg(_ap, _type) (((_ap).__ap = (void*)(_VA_ALN((_ap).__ap, _type) + _VA_RNDUP(sizeof(_type)))), (*(_type *)((int)(_ap).__ap - (__va_argcsu(_type) ? _VA_RNDUP(sizeof(_type)) : (sizeof(_type)))))) S#else S#define va_arg(_ap, _type) \ S (__va_argref(_type) \ S ? ((_ap += sizeof(_type*)),(**(_type**)(_ap-(sizeof(_type*))))) \ S : ((_ap += _VA_RNDUP(sizeof(_type))),(*(_type*)(_ap-(sizeof(_type)))))) X#define va_arg(_ap, _type) (__va_argref(_type) ? ((_ap += sizeof(_type*)),(**(_type**)(_ap-(sizeof(_type*))))) : ((_ap += _VA_RNDUP(sizeof(_type))),(*(_type*)(_ap-(sizeof(_type)))))) S#endif N#else N#ifdef __TI_EABI_SUPPORT__ S#define va_arg(_ap, _type) \ S (((_ap).__ap = (void *)(_VA_ALN((_ap).__ap,_type) + \ S _VA_RNDUP(sizeof(_type)))), \ S (*(_type *) ((int)(_ap).__ap - _VA_RNDUP(sizeof(_type))))) X#define va_arg(_ap, _type) (((_ap).__ap = (void *)(_VA_ALN((_ap).__ap,_type) + _VA_RNDUP(sizeof(_type)))), (*(_type *) ((int)(_ap).__ap - _VA_RNDUP(sizeof(_type))))) N#else N#define va_arg(_ap, _type) \ N (__va_argref(_type) \ N ? ((_ap += sizeof(_type*)), (**(_type**)(_ap- sizeof(_type*)))) \ N : ((_ap += _VA_RNDUP(sizeof(_type))), \ N (*(_type*)(_ap- _VA_RNDUP(sizeof(_type)))))) X#define va_arg(_ap, _type) (__va_argref(_type) ? ((_ap += sizeof(_type*)), (**(_type**)(_ap- sizeof(_type*)))) : ((_ap += _VA_RNDUP(sizeof(_type))), (*(_type*)(_ap- _VA_RNDUP(sizeof(_type)))))) N#endif N#endif N N#define va_end(ap) ((void)0) N N#endif /* _STDARG */ N N#if defined(__cplusplus) && !defined(_CPP_STYLE_HEADER) X#if 0L && !0L Susing std::va_list; N#endif /* _CPP_STYLE_HEADER */ L 43 "C:/ti/ccsv6/tools/compiler/arm_5.1.6/include/stdio.h" 2 N N/*---------------------------------------------------------------------------*/ N/* Attributes are only available in relaxed ANSI mode. */ N/*---------------------------------------------------------------------------*/ N#ifndef __ATTRIBUTE N#if __TI_STRICT_ANSI_MODE__ X#if 0 S#define __ATTRIBUTE(attr) N#else N#define __ATTRIBUTE(attr) __attribute__(attr) N#endif N#endif N N/*---------------------------------------------------------------------------*/ N/* A header file conforming to ARM CLIB ABI (GENC-003539), should */ N/* define _AEABI_PORTABLE when _AEABI_PORTABILITY_LEVEL is defined. */ N/*---------------------------------------------------------------------------*/ N#if defined(_AEABI_PORTABILITY_LEVEL) && !defined(_AEABI_PORTABLE) X#if 0L && !0L S#define _AEABI_PORTABLE N#endif N N/*---------------------------------------------------------------------------*/ N/* The macro definition that guards CLIB ABI (GENC-003539) requirements. */ N/*---------------------------------------------------------------------------*/ N#if defined(__TI_EABI_SUPPORT__) X#if 0L S#define _AEABI_PORTABILITY_CHECK (defined(__TMS470__) && \ S defined(__TI_EABI_SUPPORT__) && \ S _AEABI_PORTABILITY_LEVEL != 0) X#define _AEABI_PORTABILITY_CHECK (defined(__TMS470__) && defined(__TI_EABI_SUPPORT__) && _AEABI_PORTABILITY_LEVEL != 0) N#else N#define _AEABI_PORTABILITY_CHECK 0 N#endif N N#ifdef __cplusplus S//---------------------------------------------------------------------------- S// <cstdio> IS RECOMMENDED OVER <stdio.h>. <stdio.h> IS PROVIDED FOR S// COMPATIBILITY WITH C AND THIS USAGE IS DEPRECATED IN C++ S//---------------------------------------------------------------------------- Sextern "C" namespace std { N#endif N N/****************************************************************************/ N/* TYPES THAT ANSI REQUIRES TO BE DEFINED */ N/****************************************************************************/ N#ifndef _SIZE_T N#define _SIZE_T Ntypedef __SIZE_T_TYPE__ size_t; Xtypedef unsigned size_t; N#endif N Ntypedef struct { N int fd; /* File descriptor */ N unsigned char* buf; /* Pointer to start of buffer */ N unsigned char* pos; /* Position in buffer */ N unsigned char* bufend; /* Pointer to end of buffer */ N unsigned char* buff_stop; /* Pointer to last read char in buffer */ N unsigned int flags; /* File status flags (see below) */ N} FILE; N N#ifndef _FPOS_T N#define _FPOS_T N#if _AEABI_PORTABILITY_CHECK X#if 0 Stypedef struct __fpos_t_struct { S unsigned long long __pos; S struct { S unsigned int __state1, __state2; S } __mbstate; S} fpos_t; N#else Ntypedef long fpos_t; N#endif /* c6x */ N#endif /* _FPOS_T */ N N/****************************************************************************/ N/* DEVICE AND STREAM RELATED MACROS */ N/****************************************************************************/ N/****************************************************************************/ N/* MACROS THAT DEFINE AND USE FILE STATUS FLAGS */ N/****************************************************************************/ N#if _AEABI_PORTABILITY_CHECK X#if 0 Sextern FILE *__aeabi_stdin, *__aeabi_stdout, *__aeabi_stderr; S#define stdin (__aeabi_stdin) S /* pointer to a FILE object associated with standard input stream */ S#define stdout (__aeabi_stdout) S /* pointer to a FILE object associated with standard output stream */ S#define stderr (__aeabi_stderr) S /* pointer to a FILE object associated with standard error stream */ Sextern const int __aeabi_IOFBF; S#define _IOFBF (__aeabi_IOFBF) Sextern const int __aeabi_IONBF; S#define _IONBF (__aeabi_IONBF) Sextern const int __aeabi_IOLBF; S#define _IOLBF (__aeabi_IOLBF) Sextern const int __aeabi_BUFSIZ; S#define BUFSIZ (__aeabi_BUFSIZ) Sextern const int __aeabi_FOPEN_MAX; S#define FOPEN_MAX (__aeabi_FOPEN_MAX) Sextern const int __aeabi_TMP_MAX; S#define TMP_MAX (__aeabi_TMP_MAX) Sextern const int __aeabi_FILENAME_MAX; S#define FILENAME_MAX (__aeabi_FILENAME_MAX) Sextern const int __aeabi_L_tmpnam; S#define L_tmpnam (__aeabi_L_tmpnam) S N#else /* _AEABI_PORTABILITY_CHECK */ N N#define _IOFBF 0x0001 N#define _IOLBF 0x0002 N#define _IONBF 0x0004 N#define _BUFFALOC 0x0008 N#define _MODER 0x0010 N#define _MODEW 0x0020 N#define _MODERW 0x0040 N#define _MODEA 0x0080 N#define _MODEBIN 0x0100 N#define _STATEOF 0x0200 N#define _STATERR 0x0400 N#define _UNGETC 0x0800 N#define _TMPFILE 0x1000 N N#define _SET(_fp, _b) (((_fp)->flags) |= (_b)) N#define _UNSET(_fp, _b) (((_fp)->flags) &= ~(_b)) N#define _STCHK(_fp, _b) (((_fp)->flags) & (_b)) N#define _BUFFMODE(_fp) (((_fp)->flags) & (_IOFBF | _IOLBF | _IONBF)) N#define _ACCMODE(_fp) (((_fp)->flags) & (_MODER | _MODEW)) N N/****************************************************************************/ N/* MACROS THAT ANSI REQUIRES TO BE DEFINED */ N/****************************************************************************/ N#define BUFSIZ 256 N N#define FOPEN_MAX _NFILE N#define FILENAME_MAX 256 N#define TMP_MAX 65535 N N#ifdef __cplusplus S#define stdin (&std::_ftable[0]) S#define stdout (&std::_ftable[1]) S#define stderr (&std::_ftable[2]) N#else N#define stdin (&_ftable[0]) N#define stdout (&_ftable[1]) N#define stderr (&_ftable[2]) N#endif N N#define L_tmpnam _LTMPNAM N N#endif /* _AEABI_PORTABILITY_CHECK */ N N#define SEEK_SET (0x0000) N#define SEEK_CUR (0x0001) N#define SEEK_END (0x0002) N N#ifndef NULL N#define NULL 0 N#endif N N#ifndef EOF N#define EOF (-1) N#endif N N/******** END OF ANSI MACROS ************************************************/ N N#define P_tmpdir "" /* Path for temp files */ N N/****************************************************************************/ N/* DEVICE AND STREAM RELATED DATA STRUCTURES AND MACROS */ N/****************************************************************************/ N#define _NFILE 10 /* Max number of files open */ N#define _LTMPNAM 16 /* Length of temp name */ N Nextern _DATA_ACCESS FILE _ftable[_NFILE]; Xextern FILE _ftable[10]; Nextern _DATA_ACCESS char __TI_tmpnams[_NFILE][_LTMPNAM]; Xextern char __TI_tmpnams[10][16]; N N/****************************************************************************/ N/* FUNCTION DEFINITIONS - ANSI */ N/****************************************************************************/ N/****************************************************************************/ N/* OPERATIONS ON FILES */ N/****************************************************************************/ Nextern _CODE_ACCESS int remove(const char *_file); Xextern int remove(const char *_file); Nextern _CODE_ACCESS int rename(const char *_old, const char *_new); Xextern int rename(const char *_old, const char *_new); Nextern _CODE_ACCESS FILE *tmpfile(void); Xextern FILE *tmpfile(void); Nextern _CODE_ACCESS char *tmpnam(char *_s); Xextern char *tmpnam(char *_s); N N/****************************************************************************/ N/* FILE ACCESS FUNCTIONS */ N/****************************************************************************/ Nextern _CODE_ACCESS int fclose(FILE *_fp); Xextern int fclose(FILE *_fp); Nextern _CODE_ACCESS FILE *fopen(const char *_fname, const char *_mode); Xextern FILE *fopen(const char *_fname, const char *_mode); Nextern _CODE_ACCESS FILE *freopen(const char *_fname, const char *_mode, Xextern FILE *freopen(const char *_fname, const char *_mode, N register FILE *_fp); Nextern _CODE_ACCESS void setbuf(register FILE *_fp, char *_buf); Xextern void setbuf(register FILE *_fp, char *_buf); Nextern _CODE_ACCESS int setvbuf(register FILE *_fp, register char *_buf, Xextern int setvbuf(register FILE *_fp, register char *_buf, N register int _type, register size_t _size); Nextern _CODE_ACCESS int fflush(register FILE *_fp); Xextern int fflush(register FILE *_fp); N N/****************************************************************************/ N/* FORMATTED INPUT/OUTPUT FUNCTIONS */ N/****************************************************************************/ Nextern _CODE_ACCESS int fprintf(FILE *_fp, const char *_format, ...) Xextern int fprintf(FILE *_fp, const char *_format, ...) N __ATTRIBUTE ((__format__ (__printf__, 2, 3))); X __attribute__((__format__ (__printf__, 2, 3))); Nextern _CODE_ACCESS int fscanf(FILE *_fp, const char *_fmt, ...) Xextern int fscanf(FILE *_fp, const char *_fmt, ...) N __ATTRIBUTE ((__format__ (__scanf__, 2, 3))); X __attribute__((__format__ (__scanf__, 2, 3))); Nextern _CODE_ACCESS int printf(const char *_format, ...) Xextern int printf(const char *_format, ...) N __ATTRIBUTE ((__format__ (__printf__, 1, 2))); X __attribute__((__format__ (__printf__, 1, 2))); Nextern _CODE_ACCESS int scanf(const char *_fmt, ...) Xextern int scanf(const char *_fmt, ...) N __ATTRIBUTE ((__format__ (__scanf__, 1, 2))); X __attribute__((__format__ (__scanf__, 1, 2))); Nextern _CODE_ACCESS int sprintf(char *_string, const char *_format, ...) Xextern int sprintf(char *_string, const char *_format, ...) N __ATTRIBUTE ((__format__ (__printf__, 2, 3))); X __attribute__((__format__ (__printf__, 2, 3))); Nextern _CODE_ACCESS int snprintf(char *_string, size_t _n, Xextern int snprintf(char *_string, size_t _n, N const char *_format, ...) N __ATTRIBUTE ((__format__ (__printf__, 3, 4))); X __attribute__((__format__ (__printf__, 3, 4))); Nextern _CODE_ACCESS int sscanf(const char *_str, const char *_fmt, ...) Xextern int sscanf(const char *_str, const char *_fmt, ...) N __ATTRIBUTE ((__format__ (__scanf__, 2, 3))); X __attribute__((__format__ (__scanf__, 2, 3))); Nextern _CODE_ACCESS int vfprintf(FILE *_fp, const char *_format, va_list _ap) Xextern int vfprintf(FILE *_fp, const char *_format, va_list _ap) N __ATTRIBUTE ((__format__ (__printf__, 2, 0))); X __attribute__((__format__ (__printf__, 2, 0))); Nextern _CODE_ACCESS int vfscanf(FILE *_fp, const char *_fmt, va_list _ap) Xextern int vfscanf(FILE *_fp, const char *_fmt, va_list _ap) N __ATTRIBUTE ((__format__ (__scanf__, 2, 0))); X __attribute__((__format__ (__scanf__, 2, 0))); Nextern _CODE_ACCESS int vprintf(const char *_format, va_list _ap) Xextern int vprintf(const char *_format, va_list _ap) N __ATTRIBUTE ((__format__ (__printf__, 1, 0))); X __attribute__((__format__ (__printf__, 1, 0))); Nextern _CODE_ACCESS int vscanf(const char *_format, va_list _ap) Xextern int vscanf(const char *_format, va_list _ap) N __ATTRIBUTE ((__format__ (__scanf__, 1, 0))); X __attribute__((__format__ (__scanf__, 1, 0))); Nextern _CODE_ACCESS int vsprintf(char *_string, const char *_format, Xextern int vsprintf(char *_string, const char *_format, N va_list _ap) N __ATTRIBUTE ((__format__ (__printf__, 2, 0))); X __attribute__((__format__ (__printf__, 2, 0))); Nextern _CODE_ACCESS int vsnprintf(char *_string, size_t _n, Xextern int vsnprintf(char *_string, size_t _n, N const char *_format, va_list _ap) N __ATTRIBUTE ((__format__ (__printf__, 3, 0))); X __attribute__((__format__ (__printf__, 3, 0))); Nextern _CODE_ACCESS int vsscanf(const char *_str, const char *_fmt, va_list _ap) Xextern int vsscanf(const char *_str, const char *_fmt, va_list _ap) N __ATTRIBUTE ((__format__ (__scanf__, 2, 0))); X __attribute__((__format__ (__scanf__, 2, 0))); N N/****************************************************************************/ N/* CHARACTER INPUT/OUTPUT FUNCTIONS */ N/****************************************************************************/ Nextern _CODE_ACCESS int fgetc(register FILE *_fp); Xextern int fgetc(register FILE *_fp); Nextern _CODE_ACCESS char *fgets(char *_ptr, register int _size, Xextern char *fgets(char *_ptr, register int _size, N register FILE *_fp); Nextern _CODE_ACCESS int fputc(int _c, register FILE *_fp); Xextern int fputc(int _c, register FILE *_fp); Nextern _CODE_ACCESS int fputs(const char *_ptr, register FILE *_fp); Xextern int fputs(const char *_ptr, register FILE *_fp); Nextern _CODE_ACCESS int getc(FILE *_p); Xextern int getc(FILE *_p); Nextern _CODE_ACCESS int getchar(void); Xextern int getchar(void); Nextern _CODE_ACCESS char *gets(char *_ptr); Xextern char *gets(char *_ptr); Nextern _CODE_ACCESS int putc(int _x, FILE *_fp); Xextern int putc(int _x, FILE *_fp); Nextern _CODE_ACCESS int putchar(int _x); Xextern int putchar(int _x); Nextern _CODE_ACCESS int puts(const char *_ptr); Xextern int puts(const char *_ptr); Nextern _CODE_ACCESS int ungetc(int _c, register FILE *_fp); Xextern int ungetc(int _c, register FILE *_fp); N N/****************************************************************************/ N/* DIRECT INPUT/OUTPUT FUNCTIONS */ N/****************************************************************************/ Nextern _CODE_ACCESS size_t fread(void *_ptr, size_t _size, size_t _count, Xextern size_t fread(void *_ptr, size_t _size, size_t _count, N FILE *_fp); Nextern _CODE_ACCESS size_t fwrite(const void *_ptr, size_t _size, Xextern size_t fwrite(const void *_ptr, size_t _size, N size_t _count, register FILE *_fp); N N/****************************************************************************/ N/* FILE POSITIONING FUNCTIONS */ N/****************************************************************************/ Nextern _CODE_ACCESS int fgetpos(FILE *_fp, fpos_t *_pos); Xextern int fgetpos(FILE *_fp, fpos_t *_pos); Nextern _CODE_ACCESS int fseek(register FILE *_fp, long _offset, Xextern int fseek(register FILE *_fp, long _offset, N int _ptrname); Nextern _CODE_ACCESS int fsetpos(FILE *_fp, const fpos_t *_pos); Xextern int fsetpos(FILE *_fp, const fpos_t *_pos); Nextern _CODE_ACCESS long ftell(FILE *_fp); Xextern long ftell(FILE *_fp); Nextern _CODE_ACCESS void rewind(register FILE *_fp); Xextern void rewind(register FILE *_fp); N N/****************************************************************************/ N/* ERROR-HANDLING FUNCTIONS */ N/****************************************************************************/ Nextern _CODE_ACCESS void clearerr(FILE *_fp); Xextern void clearerr(FILE *_fp); Nextern _CODE_ACCESS int feof(FILE *_fp); Xextern int feof(FILE *_fp); Nextern _CODE_ACCESS int ferror(FILE *_fp); Xextern int ferror(FILE *_fp); Nextern _CODE_ACCESS void perror(const char *_s); Xextern void perror(const char *_s); N N#define _getchar() getc(stdin) N#define _putchar(_x) putc((_x), stdout) N#define _clearerr(_fp) ((void) ((_fp)->flags &= ~(_STATERR | _STATEOF))) N N#define _ferror(_x) ((_x)->flags & _STATERR) N N#define _remove(_fl) (unlink((_fl))) N N#ifdef __cplusplus S} /* extern "C" namespace std */ N#endif /* __cplusplus */ N N#endif /* #ifndef _STDIO */ N N#if defined(__cplusplus) && !defined(_CPP_STYLE_HEADER) X#if 0L && !0L Susing std::size_t; Susing std::FILE; Susing std::fpos_t; Susing std::_ftable; Susing std::__TI_tmpnams; Susing std::remove; Susing std::rename; Susing std::tmpfile; Susing std::tmpnam; Susing std::fclose; Susing std::fopen; Susing std::freopen; Susing std::setbuf; Susing std::setvbuf; Susing std::fflush; Susing std::fprintf; Susing std::fscanf; Susing std::printf; Susing std::scanf; Susing std::sprintf; Susing std::snprintf; Susing std::sscanf; Susing std::vfprintf; Susing std::vprintf; Susing std::vsprintf; Susing std::vsnprintf; Susing std::fgetc; Susing std::fgets; Susing std::fputc; Susing std::fputs; Susing std::getc; Susing std::getchar; Susing std::gets; Susing std::putc; Susing std::putchar; Susing std::puts; Susing std::ungetc; Susing std::fread; Susing std::fwrite; Susing std::fgetpos; Susing std::fseek; Susing std::fsetpos; Susing std::ftell; Susing std::rewind; Susing std::clearerr; Susing std::feof; Susing std::ferror; Susing std::perror; S#if _AEABI_PORTABILITY_CHECK Susing std::__aeabi_stdin; Susing std::__aeabi_stdout; Susing std::__aeabi_stderr; Susing std::__aeabi_IOFBF; Susing std::__aeabi_IONBF; Susing std::__aeabi_IOLBF; Susing std::__aeabi_BUFSIZ; Susing std::__aeabi_FOPEN_MAX; Susing std::__aeabi_TMP_MAX; Susing std::__aeabi_FILENAME_MAX; Susing std::__aeabi_L_tmpnam; S#endif S N#endif /* _CPP_STYLE_HEADER */ N N L 2 "D:/prj/mtg_ccs6/shl/cvr730/test.c" 2 N Nint dbg_LogMsg(unsigned char id, char* msg) N{ N printf("%03d %s\n",id,msg); N return 0; N} N Nvoid main(void) N{ E "D:/prj/mtg_ccs6/shl/cvr730/test.c" 11 22 expected a ")" N dbg_LogMsg(55,"ERR."__FUNCTION__); N}
"C:/ti/ccsv6/tools/compiler/arm_5.1.6/bin/armcl" -mv5e --code_state=32 --abi=ti_arm9_abi -me -O2 -g --include_path="C:/ti/ccsv6/tools/compiler/arm_5.1.6/include" --gcc --define="_DEBUG" --diag_warning=225 --diag_error=225 --display_error_number --printf_support=nofloat --std_lib_func_redefined --preproc_with_compile --preproc_dependency="test.pp" --gen_acp_raw --verbose_diagnostics "D:/prj/mtg_ccs6/shl/cvr730/test.c"
"D:/prj/mtg_ccs6/shl/cvr730/test.c", line 11: error #18: expected a ")"
dbg_LogMsg(55,"ERR."__FUNCTION__);
^
1 error detected in the compilation of "D:/prj/mtg_ccs6/shl/cvr730/test.c".
Regards,
Yulin.
__FUNCTION__ is not a preprocessor name. It is a variable. You need to change your code to expect a variable where you want to use __FUNCTION__. The implementation of dbg_LogMsg needs to change to ...
int dbg_LogMsg(unsigned char, char *, const char *);
A call to it looks like ...
dbg_LogMsg(55, "ERR.", __FUNCTION__);
The GCC compiler documentation on __FUNCTION__ can be found at https://gcc.gnu.org/onlinedocs/gcc/Function-Names.html .
Thanks and regards,
-George