atom / node-spellchecker

SpellChecker Node Module
http://atom.github.io/node-spellchecker
MIT License
300 stars 108 forks source link

clang and gcc compilation errors #26

Open yurivict opened 8 years ago

yurivict commented 8 years ago

Getting these errors with clang:

> spellchecker@3.1.3 install /usr/ports/editors/atom/work/atom-2bec69f/node_modules/spell-check/node_modules/spellchecker
> node-gyp rebuild

gmake[1]: Entering directory '/usr/ports/editors/atom/work/atom-2bec69f/node_modules/spell-check/node_modules/spellchecker/build'
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o
In file included from ../vendor/hunspell/src/hunspell/affentry.cxx:9:
../vendor/hunspell/src/hunspell/affentry.hxx:30:94: error: cannot initialize a parameter of type 'unsigned short' with an rvalue of type 'nullptr_t'
  struct hentry *      check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                                             ^          ~~~~
../vendor/hunspell/src/hunspell/affentry.hxx:30:94: note: passing argument to parameter 'needflag' here
../vendor/hunspell/src/hunspell/affentry.hxx:93:103: error: cannot initialize a parameter of type 'unsigned short' with an rvalue of type 'nullptr_t'
  struct hentry *   check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
                                                                                                      ^          ~~~~
../vendor/hunspell/src/hunspell/affentry.hxx:93:103: note: passing argument to parameter 'needflag' here
../vendor/hunspell/src/hunspell/affentry.cxx:544:47: warning: while loop has empty body [-Wempty-body]
                        while (p && *p != ']' && (p = nextchar(p)));
                                                                   ^
  /vendor/hunspell/src/hunspell/affentry.cxx:544:47: note: put the semicolon on a separate line to silence this warning

and similar errors with gcc-4.8 on FreeBSD 10.2:

gmake[1]: Entering directory '/usr/ports/editors/atom/work/atom-2bec69f/node_modules/spell-check/node_modules/spellchecker/build'
  CXX(target) Release/obj.target/hunspell/vendor/hunspell/src/hunspell/affentry.o
In file included from /usr/local/lib/gcc48/gcc/x86_64-portbld-freebsd10.1/4.8.4/include-fixed/stdlib.h:46:0,
                 from ../vendor/hunspell/src/hunspell/affentry.cxx:4:
../vendor/hunspell/src/hunspell/affentry.hxx:30:105: error: could not convert 'nullptr' from 'std::nullptr_t' to 'short unsigned int'
   struct hentry *      check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
                                                                                                         ^
../vendor/hunspell/src/hunspell/affentry.hxx:93:114: error: could not convert 'nullptr' from 'std::nullptr_t' to 'short unsigned int'
   struct hentry *   check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL);
sarahhodne commented 8 years ago

CXXFLAGS="-std=c++03" fixed this for me.

aluxian commented 8 years ago

@henrikhodne @zcbenz Any idea what could be causing this error?

https://travis-ci.org/Aluxian/Whatsie/builds/118493607

> spellchecker@3.2.3 install /Users/travis/build/Aluxian/Whatsie/src/node_modules/spellchecker
> node-gyp rebuild
-  CXX(target) Release/obj.target/spellchecker/src/main.o
  CXX(target) Release/obj.target/spellchecker/src/spellchecker_mac.o
-\  CXX(target) Release/obj.target/spellchecker/src/transcoder_posix.o
../src/transcoder_posix.cc:17:28: error: expected expression
  two_byte_value.integer = {0x0102};
                           ^
1 error generated.
make: *** [Release/obj.target/spellchecker/src/transcoder_posix.o] Error 1

I don't have much experience with C++ compilation so I'm not sure I understand how everything works. What could be the cause of that error? Compilers on Travis too old? How can I debug it? What would you do?

My .travis.yml is similar to the one from node-spellchecker. See what I've tried here (my .travis.yml file history).

Thanks!

aluxian commented 8 years ago

Nevermind, I fixed it <3

I used electron-gyp from the beginning to install the modules. https://travis-ci.org/Aluxian/Whatsie/builds/118535163