Project

General

Profile

Actions

Bug #940

closed

ruby/config.h:1:1: warning: "PACKAGE_NAME" redefined

Added by bugmenot (bugmenot bugmenot) over 12 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.2dev
Backport:
[ruby-core:20938]

Description

=begin
When including in a C program there is this error in the header:
In file included from /usr/include/ruby-1.9.0/ruby/ruby.h:25,
from /usr/include/ruby-1.9.0/ruby.h:15,
/usr/include/ruby-1.9.0/x86_64-linux/ruby/config.h:1:1: warning: "PACKAGE_NAME" redefined

Taking the Ubuntu intrepid package:
http://packages.ubuntu.com/intrepid/ruby1.9-dev
=end

Actions #1

Updated by shyouhei (Shyouhei Urabe) over 12 years ago

  • Category set to ext
  • Priority changed from Normal to 3

=begin
Can't reproduce.

I suspect you defined PACKAGE_NAME somewhere else.
=end

Actions #2

Updated by yugui (Yuki Sonoda) over 12 years ago

  • Target version set to 1.9.1 RC2

=begin

=end

Actions #3

Updated by yugui (Yuki Sonoda) over 12 years ago

  • Status changed from Open to Rejected

=begin

=end

Actions #4

Updated by shammash (Luca Bigliardi) almost 12 years ago

=begin
How to reproduce:

  • start a project with autotools (including autoheader)
  • create a C/C++ file including both ruby.h and config.h generated by autotools =end
Actions #5

Updated by matz (Yukihiro Matsumoto) almost 12 years ago

=begin
Hi,

In message "Re: [ruby-core:23973] [Bug #940] ruby/config.h:1:1: warning: "PACKAGE_NAME" redefined"
on Tue, 23 Jun 2009 08:24:42 +0900, Luca Bigliardi redmine@ruby-lang.org writes:

|How to reproduce:
|
|- start a project with autotools (including autoheader)
|- create a C/C++ file including both ruby.h and config.h generated by autotools

I have no idea to fix this issue when including independently
generated header files in single source file. Probably people behind
autotools know how to resolve.

                        matz.

=end

Actions #6

Updated by shammash (Luca Bigliardi) almost 12 years ago

=begin
Let me explain you a bit more what's happening:

  • Autotools are a widely used, long time existing tool for handling C/C++ projects ( http://en.wikipedia.org/wiki/GNU_build_system )
  • If in your project you have to do conditional compilation depending on the features found by the "./configure" script then the way to do it is let autotools define in config.h something like HAVE_FEATURE so in your code you simply do: #ifdef HAVE_FEATURE .... #endif
  • If in a C/C++ module you have to deal at the same time with conditional compilation and ruby bindings then you have to include both config.h and ruby.h
  • Ruby somewhere defines its own PACKAGE_NAME PACKAGE_STRING PACKAGE_TARNAME PACKAGE_VERSION which are already defined in config.h created by your "./configure".

To me it sounds like the problem comes our from the fact that you're installing your own
config.h and referencing it from an header you provide as an interface.

Thank you,

luca

=end

Actions #7

Updated by nobu (Nobuyoshi Nakada) almost 12 years ago

  • Status changed from Rejected to Assigned
  • Assignee set to yugui (Yuki Sonoda)
  • Target version changed from 1.9.1 RC2 to 1.9.1
  • ruby -v set to ruby 1.9.2dev

=begin
fixed at r23827
=end

Actions #8

Updated by yugui (Yuki Sonoda) almost 12 years ago

  • Status changed from Assigned to Closed

=begin

=end

Actions

Also available in: Atom PDF