Menu

C-style array, not reported as an ArrayType

Developers
widheg
2009-12-30
2012-10-08
  • widheg

    widheg - 2009-12-30

    I noticed that when declaring an array in the (discouraged but yet allowed)
    C-style way, then Recoder does not report the type as an ArrayType. For
    example:

    int c = {1,2,3};

    is not reported as an ArrayType, whereas the equivalent declaration

    int c = {1,2,3};

    is.

     
  • Tobias Gutzmann

    Tobias Gutzmann - 2010-01-14

    Hej,

    what exactly do you ask for the type? If it is the TypeReference "int", then
    it that's actually correct! "int" does not reference an ArrayType. The
    LocalVariableDeclaration in the AST behaves the same. Example:
    The VariableSpecification "c", however, should in both cases be reported as an
    ArrayType.
    Here is a very motivation example for this behavior:

    int c, d;

    Regards,
    Tobias

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.