Bug 1082054 - plplot does not play well with HAVE_CONFIG_H macro
Summary: plplot does not play well with HAVE_CONFIG_H macro
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: plplot
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1078758
TreeView+ depends on / blocked
 
Reported: 2014-03-28 14:54 UTC by Sergio Pascual
Modified: 2014-06-17 13:45 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-06-17 13:45:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Sergio Pascual 2014-03-28 14:54:01 UTC
I'm compiling a program that requires plplot and, during its compilation defines the (very common) macro HAVE_CONFIG_H

Try this

$ cat test.c

#include "plplot.h"

$ gcc -DHAVE_CONFIG_H -I.  -I/usr/include/plplot  -c test.c

The compilation fails with

In file included from /usr/include/plplot/plplot.h:36:0,
                 from test.c:1:
/usr/include/plplot/plConfig.h:53:22: fatal error: config.h: No such file or directory
 #  include <config.h>

because plConfig.h contains 

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

so this will fail if you don't have a config.h your include path, or worse, it will include the config.h or your project inside plplot.h (and you won't notice anything)

In Rawhide the file has this instead

#ifdef HAVE_CONFIG_H
#  include <plplot_config.h>
#endif

so it will always fail if you have HAVE_CONFIG_H defined.

C macros are ... funny...

May be solution to redefine the HAVE_CONFIG_H to HAVE_PLPLOT_CONFIG_H to avoid name colission?

Comment 1 Orion Poplawski 2014-06-10 14:33:10 UTC
This is fixed in 5.10.0-9.fc21.  I can back port to f20 if still needed.

Comment 2 Sergio Pascual 2014-06-17 10:00:42 UTC
No, it's not needed, thank you. You can close the ticket if you want

Comment 3 Orion Poplawski 2014-06-17 13:45:30 UTC
Will do.


Note You need to log in before you can comment on or make changes to this bug.