Actions
Bug #11426
closedmoving RClass does shows warning even if RClass itself is not used
Description
i got the following warning when i want to build my binding with using ruby from trunk
/usr/local/rvm/rubies/ruby-head/include/ruby-2.3.0/ruby/ruby.h:827:16: warning: attribute ignored in declaration of ‘struct RClassDeprecated’ [-Wattributes]
#define RClass RClassDeprecated
^
/usr/local/rvm/rubies/ruby-head/include/ruby-2.3.0/x86_64-linux/ruby/config.h:127:67: note: in definition of macro ‘DEPRECATED_TYPE’
#define DEPRECATED_TYPE(mesg,x) __attribute__ ((deprecated mesg)) x
^
/usr/local/rvm/rubies/ruby-head/include/ruby-2.3.0/ruby/ruby.h:829:8: note: in expansion of macro ‘RClass’
struct RClass {
^
/usr/local/rvm/rubies/ruby-head/include/ruby-2.3.0/ruby/ruby.h:827:16: note: attribute for ‘struct RClassDeprecated’ must follow the ‘struct’ keyword
#define RClass RClassDeprecated
^
/usr/local/rvm/rubies/ruby-head/include/ruby-2.3.0/x86_64-linux/ruby/config.h:127:67: note: in definition of macro ‘DEPRECATED_TYPE’
#define DEPRECATED_TYPE(mesg,x) __attribute__ ((deprecated mesg)) x
^
/usr/local/rvm/rubies/ruby-head/include/ruby-2.3.0/ruby/ruby.h:829:8: note: in expansion of macro ‘RClass’
struct RClass {
^
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
- Description updated (diff)
- Status changed from Open to Feedback
What version of gcc
?
Updated by Hanmac (Hans Mackowiak) almost 10 years ago
"gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)" shipped with Ubuntu
EDIT: i fixed the warning with doing this:
#define RClass RClassDeprecated
struct DEPRECATED_TYPE(("RClass is internal use only"),
RClass {
struct RBasic basic;
});
but i am unsure for what #define RClass RClassDeprecated is for, because there is no RClassDeprecated ...
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
I've misread as that the warnings are shown when compiling ruby.
What's your binding?
Please explain exact steps to reproduce.
Updated by Hanmac (Hans Mackowiak) almost 10 years ago
i am building this:
https://github.com/Hanmac/rwx
the error happen when i do:
cd ext
ruby extconf.rb (there are already the warnings in the mkmf.log)
and when i do
make
then the warning does appear for each object file it builds.
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
OK, g++
does reject __attribute__
between struct
and a name, while gcc
allows.
$ cat a.c
__attribute__((deprecated)) struct a;
$ gcc -c a.c
$ g++ -c a.c
a.c:1:36: warning: attribute ignored in declaration of 'struct a' [-Wattributes]
__attribute__((deprecated)) struct a;
^
a.c:1:36: note: attribute for 'struct a' must follow the 'struct' keyword
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
- Status changed from Feedback to Closed
Applied in changeset r51621.
ruby.h: adjust for g++
- include/ruby/ruby.h (RClass): move
__attribute__
after the
keywordstruct
for g++. [ruby-core:70297] [Bug #11426]
Actions
Like0
Like0Like0Like0Like0Like0Like0