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

#108 Minimal example for not working macro expansion

open
nobody
semantic (53)
5
2012-06-14
2012-06-14
Eric Wolf
No

Consider the following three files:

minimal-example.h:

#ifndef MINIMAL_H
#define MINIMAL_H

#define HIDEIT _
#define HIDECAT1(x,y) x ## y ## x
#define HIDECAT(x,y) HIDECAT1(x,y)

#endif

minimal-example2.h:

#ifndef MINIMAL_2_H
#define MINIMAL_2_H

#define PUFFERHIDE(x) HIDECAT(HIDEIT,x)

struct test_struct {
int a;
int PUFFERHIDE(b);
};

typedef struct test_struct * test_p;

#endif

minimal.c:

#include "minimal-example.h"
#include "minimal-example2.h"

int main(int argc, char * argv[]) {
test_p pup;
pup->
}

If you press C-c , <SPC> after pup-> the member _b_ will not show up.

Discussion

  • Eric Wolf
    Eric Wolf
    2012-06-14

     
    Attachments
  • Eric Wolf
    Eric Wolf
    2012-06-14

     
    Attachments
  • Eric Wolf
    Eric Wolf
    2012-06-14

     
    Attachments
  • Eric Wolf
    Eric Wolf
    2012-06-14

    emacs 24.1
    M-x list-packages tells me
    semantic 2.0
    cedet 1.0pre7