Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#42 Parses some C function decls incorrectly

closed-fixed
nobody
semantic (53)
5
2005-06-30
2002-09-06
Anonymous
No

Hi,

I believe I've found some bugs in how semantic parses
function declarations in C. Enter the following function
declaration:

static const char *g(long int x)

Place the cursor on the function name and watch what
semantic outputs in the minibuffer:

Function: const static char *g (long ,int x)

Two problems here: Semantic does not seem to
handle "long int" properly, but considers it two
arguments ("long int" is a valid way of writing "long" in
C). Also, the order of const and static is wrong. This
matters with some compilers if you want to use the
output to auto-generate function declarations.

I have semantic 1.4 installed.

/Petter

Discussion

  • Eric M. Ludlam
    Eric M. Ludlam
    2005-06-30

    • status: open --> closed-fixed
     
  • Eric M. Ludlam
    Eric M. Ludlam
    2005-06-30

    Logged In: YES
    user_id=88537

    I tried this in the latest CEDET pre-release, it is is now
    fixed, producing the nice output of:

    const static char* g (long int x)

    which is (admittedly) not perfect, but the specified bug has
    been fixed.