Opened 7 years ago

Closed 7 years ago

#36397 closed defect (fixed)

jgraph-8.3 fails to compile with clang

Reported by: brett.higgins@… Owned by: s@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: clang Cc:
Port: jgraph

Description

Short version: clang doesn't like old-style C function definitions. configure.cc gives clang on Mountain Lion (maybe on others?), so jgraph fails to compile.

Lots of warnings like this:

edit.c:683:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
edit_hash_label(a)
^~~~~~~~~~~~~~~

and resulting errors like this:

edit.c:700:40: error: non-void function 'edit_hash_label' should return a value [-Wreturn-type]
        if ((s = getlabel()) == CNULL) return;
                                       ^

Adding

configure.compiler   gcc

to the Portfile resolves the issue. (Alternative fix would be to patch all the old-style definitions; obviously more laborious.)

Attachments (15)

patch-draw.c.diff (3.4 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-edit.c.diff (3.3 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-jgraph.c.diff (2.3 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-jgraph.h.diff (2.8 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-list.c.diff (1.6 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-list.h.diff (776 bytes) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-makefile.diff (1.1 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-printline.c.diff (4.4 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-prio_list.c.diff (567 bytes) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-prio_list.h.diff (250 bytes) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-process.c.diff (3.8 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-show.c.diff (2.3 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
patch-token.c.diff (3.4 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
Portfile (3.4 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.
Portfile.diff (1.5 KB) - added by stevecheckoway (Stephen Checkoway) 7 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 in reply to:  description Changed 7 years ago by ryandesign (Ryan Schmidt)

Keywords: clang added
Owner: changed from macports-tickets@… to s@…

Replying to brett.higgins@…:

configure.cc gives clang on Mountain Lion (maybe on others?)

On Xcode 4.2 and up.

Adding

configure.compiler   gcc

to the Portfile resolves the issue. (Alternative fix would be to patch all the old-style definitions; obviously more laborious.)

compiler.blacklist clang

is what we would want to put, if we cannot fix it to compile with clang.

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-draw.c.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-edit.c.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-jgraph.c.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-jgraph.h.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-list.c.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-list.h.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-makefile.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-printline.c.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-prio_list.c.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-prio_list.h.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-process.c.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-show.c.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: patch-token.c.diff added

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: Portfile added

comment:2 Changed 7 years ago by stevecheckoway (Stephen Checkoway)

I've uploaded a bunch of patches that allow jgraph to be compiled without error.

The new Portfile should fix ticket #36405 as well.

I've also changed my email address to match what I use for trac.

comment:3 Changed 7 years ago by mf2k (Frank Schima)

Please instead attach a unified diff of the portfile so we can see what changes you made.

Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Attachment: Portfile.diff added

comment:4 in reply to:  3 Changed 7 years ago by stevecheckoway (Stephen Checkoway)

Replying to macsforever2000@…:

Please instead attach a unified diff of the portfile so we can see what changes you made.

Done.

comment:5 in reply to:  2 Changed 7 years ago by ryandesign (Ryan Schmidt)

Replying to s@…:

The new Portfile should fix ticket #36405 as well.

I applied that portion of the patch in r98258.

comment:6 Changed 7 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: newclosed

Committed in r98260 and r98261.

Note: See TracTickets for help on using tickets.