New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #35406 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

xfig @3.2.5b_5 Build failure – wrong return value declaration for main()

Reported by: hanche@… Owned by: ryandesign@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: carl.mummert@…
Port: xfig

Description

Xfig did not build for me using clang because main() is declared to return void, and clang issued an error instead of just a warning (as I would have expected). The fix is of course trivial:

--- main.c_ORIG 2009-03-30 17:52:18.000000000 +0200
+++ main.c      2012-07-29 16:48:38.000000000 +0200
@@ -629,7 +629,7 @@
 int setup_visual (int *argc_p, char **argv, Arg *args);
 void get_pointer_mapping (void);
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
     Widget         children[NCHILDREN];
     XEvent         event;

Change History

comment:1 follow-up: ↓ 2 Changed 10 months ago by ryandesign@…

  • Owner changed from macports-tickets@… to ryandesign@…

On what OS X version did you encounter this error with what version of Xcode? I just fixed it yesterday to compile correctly on Mountain Lion with Xcode 4.4...

comment:2 in reply to: ↑ 1 Changed 10 months ago by hanche@…

Yeah, sorry I didn't mention that. OS X 10.7.4, Xcode 4.3.2.

And oddly enough, xfig @3.2.5b_4 compiled fine, though I don't know what versions I had when I built that.

I did see the ticket and patch you refer to, but they didn't touch main.

comment:3 Changed 10 months ago by carl.mummert@…

  • Cc carl.mummert@… added

Cc Me!

comment:4 Changed 10 months ago by and.damore@…

  • Status changed from new to closed
  • Resolution set to fixed

Just reproduced on 10.7.4 with XCode 4.4 while upgrading xfig.

Fixed in r96209, ticket closed.

Note: See TracTickets for help on using tickets.