Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure building with GCC 4.9.1 #200

jamielinux opened this Issue Sep 20, 2014 · 1 comment


None yet
3 participants
Copy link

commented Sep 20, 2014

Building weechat 1.0 on Fedora Rawhide fails. Possibly related to GCC 4.9.1.

The build succeeds when passing -O0 to cflags.

$ gcc --version
gcc (GCC) 4.9.1 20140912 (Red Hat 4.9.1-9)

mock build.log.
mock root.log.

Excerpt from build.log:

[ 21%] Building C object src/plugins/alias/CMakeFiles/alias.dir/alias.o
cd /builddir/build/BUILD/weechat-1.0/build/src/plugins/alias && /usr/bin/cc  -DENABLE_NLS -DHAVE_CONFIG_H -DHAVE_GCRYPT -DHAVE_GNUTLS -DHAVE_ICONV -DHAVE_ZLIB -DWEECHAT_LICENSE=\"GPL3\" -DWEECHAT_VERSION=\"1.0\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES -Dalias_EXPORTS -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic  -Wall -Wextra -Werror-implicit-function-declaration -fPIC -I/builddir/build/BUILD/weechat-1.0/build    -fPIC -o CMakeFiles/alias.dir/alias.o   -c /builddir/build/BUILD/weechat-1.0/src/plugins/alias/alias.c
In file included from /usr/include/string.h:634:0,
                 from /builddir/build/BUILD/weechat-1.0/src/plugins/alias/alias.c:24:
/builddir/build/BUILD/weechat-1.0/src/plugins/alias/alias.c: In function 'alias_string_add_word_range':
/builddir/build/BUILD/weechat-1.0/src/plugins/alias/../weechat-plugin.h:978:21: error: expected identifier before '(' token
     weechat_plugin->strndup(__string, __length)
/builddir/build/BUILD/weechat-1.0/src/plugins/alias/alias.c:143:12: note: in expansion of macro 'weechat_strndup'
     word = weechat_strndup (start, end - start);
/builddir/build/BUILD/weechat-1.0/src/plugins/alias/alias.c:138:69: warning: unused parameter 'start' [-Wunused-parameter]
 alias_string_add_word_range (char **alias, int *length, const char *start,
/builddir/build/BUILD/weechat-1.0/src/plugins/alias/alias.c:139:42: warning: unused parameter 'end' [-Wunused-parameter]
                              const char *end)
src/plugins/alias/CMakeFiles/alias.dir/build.make:54: recipe for target 'src/plugins/alias/CMakeFiles/alias.dir/alias.o' failed
make[2]: *** [src/plugins/alias/CMakeFiles/alias.dir/alias.o] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/weechat-1.0/build'
CMakeFiles/Makefile2:857: recipe for target 'src/plugins/alias/CMakeFiles/alias.dir/all' failed
make[1]: *** [src/plugins/alias/CMakeFiles/alias.dir/all] Error 2
make[1]: Leaving directory '/builddir/build/BUILD/weechat-1.0/build'
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

This comment has been minimized.

Copy link

commented Sep 20, 2014

I can confirm this. I'm getting the same exact error on Arch Linux. I'm using:

cmake 3.0.2
gcc (GCC) 4.9.1 20140903 (prerelease)
glibc 2.20

@flashcode flashcode added the bug label Sep 20, 2014

@flashcode flashcode added this to the 1.0.1 milestone Sep 20, 2014

@flashcode flashcode self-assigned this Sep 20, 2014

flashcode added a commit that referenced this issue Sep 20, 2014

core: fix compilation of plugin API functions (macros) when compiler …
…optimizations are enabled (closes #200)

(cherry picked from commit 03c0067)

@flashcode flashcode closed this in 03c0067 Sep 20, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.