1

There is already a question on this but it's unanswered.

I'm writing a C++ header file that requires libxml, as seen below

#include <libxml2/libxml/xpath.h>

However Flycheck sees this as an error and consequently ignores any other potential error in the file.

In include /usr/include/libxml2/libxml/xpath.h (c/c++-gcc)

How do I disable this error in Flycheck or at least configure it to recognize the rest of the errors in the file?


Here's my code:

#ifndef PATH_T_HPP
#define PATH_T_HPP

#include <string>
#include <libxml2/libxml/xpath.h>

namespace tw_lmm
{

  class path_t
  {
  public:
    /* Constructors */
    explicit path_t(const xmlKey*); // path only
    explicit path_t(const xmlKey*, const xmlKey*); // path, name
    explicit path_t(const xmkKey*, const xmkKey*, const xmkKey*); // path, name, extension

    explicit path_t(const path_t&);

    inline path_t operator=(const std::string&); // path only

    /* Destructors */
    virtual ~path_t();

    /* Getters */
    const inline std::string& path() const;
    const inline std::string& name() const;

  protected:
    std::string __path, __name, __extension;

  };

  const inline std::string& path_t::path() const
  {
    return __path;
  }

}

#endif

Note I misspelt xmlKey by writing xmkKey, Flycheck doesn't seem to recognise this.

0

According to Sebastian Wiesner (lunaryorn) in Flycheck issue #662,

Flycheck does not have its own way to ignore warnings, but relies on syntax checker to be able to ignore warnings on their own.

I was able to add "/usr/include/libxml2" to variable flycheck-gcc-include-path using

M-x customize-variable RET flycheck-gcc-include-path

an insert a new entry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.