SlickEdit Product Discussion > SlickEdit®

struct within typedef'd struct



I'm seeing references to a struct within a typedef'd struct being marked as unknown symbol, see attached pic.

--- Code: ---typedef struct lfs {
    lfs_cache_t rcache;
    lfs_cache_t pcache;

    struct lfs_mlist {
        struct lfs_mlist *next;
        uint16_t id;
        uint8_t type;
        lfs_mdir_t m;
    } *mlist;

    struct  {
        lfs_block_t off;
        lfs_block_t size;
        lfs_block_t i;
        lfs_block_t ack;
        uint32_t *buffer;
    } lfs_free;

    const struct lfs_config *cfg;
} lfs_t;

--- End code ---

I'm using SE 25.0.2.


That is a difference between ANSI-C and C++ scoping.  You'll need to do a Document > Select Mode > ANSI-C for header files containing that sort of struct definition (then tickle the file and save it so it gets retagged).

Ok, thanks.

I found that there is also a problem with the ANSI-C parser with nested enums.

I am fixing that for the next release (v26), and also adding an option for the C/C++ tagging to treat nested structs and enums the way ANSI-C does.  That way, if you are working with mixed source, *and* you do not frequently nest structs/unions/enums within your C++ structs, you might be able to turn that option on and work fairly seamlessly, even if you have certain header files begin recognized in the wrong mode.

Thanks, that would help alot, I appreciate it.



[0] Message Index

Go to full version