IBM Support

LI75568: SYNTAX ERROR FOR DATA STRUCTURE MEMBERS

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The compiler produces a syntax message for the following
    test case:
    
    ======Compile Line:
    xlC_r -c  test.cpp
    
    ===== TESTCASE:
    $cat test.cpp
    #include <stdarg.h>
    typedef unsigned long vportULong;
    typedef long vportLong;
    
    typedef void (*vportSIG_PF)(int);
    
    extern  const int vportBUILD_NUMBER;
    
    extern "C" {
    
    }
    extern "C" {
    
    }
    extern "C" {
    
    extern "C" {
    
    }
    extern "C" {
    
    typedef char *va_list;
    
    }
    extern "C" {
    
    }
    }
    
    typedef struct vArgListTag {
      va_list v;
    } vArgList;
    
    
    void galaxySignal(char *fmt, ...)
    {
      vArgList list;
      va_start(list.v, fmt);
    }
    
    
    int main(int argc, char **argv)
    {
    
    return 0;
    }
    
    ===== ACTUAL OUTPUT:
    $
    /.../torolab.ibm.com/fs/projects/vabld/run/vacpp/101_com/aix/dai
    ly/latest/bin/xlC_r -c  test.cpp
    "test.cpp", line 38.16: 1540-0064 (S) Syntax error:  "," was
    expected but "." was found.
    $
    
    ===== EXPECTED OUTPUT:
    Should compile clean
    

Local fix

  • Replacing
      va_start(list.v, fmt);
    
    with
      va_list &listv = list.v;
      va_start(listv, fmt);
    
    will help you workaround this issue.
    

Problem summary

  • USERS AFFECTED:
    Users using va_start with expressions such as a member access
    are affected by this issue.
    
    PROBLEM DESCRIPTION:
    Parser grammar for __builtin_va_start restricted to
    parenthesized names.
    

Problem conclusion

  • Modified the grammar to allow more general expressions and
    added additional type analysis for arguments.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI75568

  • Reported component name

    XL C/C++ RHEL52

  • Reported component ID

    5724U8310

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2010-07-28

  • Closed date

    2010-07-28

  • Last modified date

    2010-07-28

  • APAR is sysrouted FROM one or more of the following:

    IZ73174

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL C/C++ RHEL52

  • Fixed component ID

    5724U8310

Applicable component levels

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
17 October 2021