Skip to content

Irony auto-complete for structure with macro inside #572

Open
@wanghaiqiangk

Description

@wanghaiqiangk

The definition of struct sigaction is

struct sigaction
  {
    /* Signal handler.  */
#ifdef __USE_POSIX199309
    union
      {
	/* Used if SA_SIGINFO is not set.  */
	__sighandler_t sa_handler;
	/* Used if SA_SIGINFO is set.  */
	void (*sa_sigaction) (int, siginfo_t *, void *);
      }
    __sigaction_handler;
# define sa_handler	__sigaction_handler.sa_handler
# define sa_sigaction	__sigaction_handler.sa_sigaction
#else
    __sighandler_t sa_handler;
#endif

    /* Additional set of signals to be blocked.  */
    __sigset_t sa_mask;

    /* Special flags.  */
    int sa_flags;

    /* Restore handler.  */
    void (*sa_restorer) (void);
  };

Without special requirement or using obsolescent compiler, the compiler usually chooses the #else so that sa_handler is one of members.

But irony doesn't show any candidates for sa_handler, my irony gives
image

There are duplicated items for the same candidate. That's because I'm using both irony and rtags. Both of them don't show sa_handler. But since they use clang as backend. I suspect it is a problem of clang, isn't it? There is another possible reason that I can come up with, that is there may be an option about compiler definition which should be given to irony but omitted.

Can anyone help? Thank ahead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions