Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001505graphvizBuild/Installpublic2008-12-20 01:412011-04-28 04:03
ReporterChris Demetriou 
Assigned Toellson 
PlatformOS*-*-OS Version
Summary0001505: conflicting types of declarations of gvplugin_installed_t arrays

There are lots of arrays in the source of gv_plugin_installed_t.

When these are defined, they're typically defined like:

gv_plugin_installed_t foo[] = { ... };

But when they're used, they're declared like:

extern gvplugin_installed_t foo;

This violates the C standard, which states that "All declarations that
refer to the same object or function shall have compatible type;
otherwise, the behavior is undefined." (That's from ISO/IEC 9899:TC2
final committee draft, section 6.2.7.) Further reading indicates to
me (and another person that I checked with who's familiar with reading
these standards) that this is not, in fact, compatible.

This doesn't trigger issues with most C implementations, but there
is one implementation in development (GCC LTO branch) which does
flag this issue.

This patch is against 20081219.0545 -- I didn't send a diff against
cvs head because I don't have the right autotools (and can't easily
install them right now), so couldn't configure it. I figured i'd
be better to send you something that I could compile, vs., something
that I couldn't even if it's an easy change. You can find any
that I missed in the current srcs by grepping for
'^extern gvplugin_installed_t .*[^]];'
after integrating my patch.
Additional Information

[ellson] hanks for this. Patch applied to CVS head. Should be in tomorrow's snapshot.
TagsNo tags attached.
change the externs to use [], get rid of the &'s where they are used.

Since you don't have an attachment form for 'patch' to fix the issue,
I've attached it as the output file.

Hopefully you'll be able to use the patch to save you a few minutes
to fix
STATUS-COMMENTFixed (21 Dec 2008)
VERSION     2.21.20081219.0545
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => user695

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker