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

#103 typedef problem

open
nobody
semantic (53)
5
2010-12-14
2010-12-14
Anonymous
No

============================================
typedef struct _test
{
int field_a;
int field_b;
} TEST;

int main(int argc, char *argv[])
{
TEST t;
if ( t. //doesn't work

return 0;
}
--------------------------------------------
M-x semantic-analyze-current-context

Context Type: #<semantic-analyze-context context>
Bounds: (113 . 113)
Prefix: "t"
""
Prefix Classes: 'function
'variable
'type
Encountered Errors: '(error "Cannot find definition for \"t\"")
--------
-> Local Args: int argc
char* argv[]
-> Local Vars: int argc
char* argv[]
============================================

but

typedef struct _test
{
int field_a;
int field_b;
} TEST;

int main(int argc, char *argv[])
{
TEST t;
t. //works correctly

return 0;
}
--------------------------------------------
M-x semantic-analyze-current-context

Context Type: #<semantic-analyze-context context>
Bounds: (108 . 108)
Prefix: TEST t
""
Prefix Classes: 'function
'variable
'type
Prefix Types: struct _test {}
--------
-> Local Args: int argc
char* argv[]
-> Local Vars: int argc
char* argv[]
TEST t
============================================

Discussion