Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#972 closed Bug (fixed)

Transmission fails to compile with Sun Studio due to funky C code

Reported by: trisk Owned by: charles
Priority: Low Milestone: 1.22
Component: Transmission Version: 1.21
Severity: Major Keywords: sun studio, anonymous union, compile
Cc:

Description

The new JSON parser uses an anonymous union containing an anonymous struct to represent JSON data types. Unfortunately, anonymous unions and structs are strictly a GCC-ism and are not permitted in C (not even C99), so it fails to compile with Sun Studio.

Naming the structs (as in the attached patch) fixes the problem, but it makes the interface for the JSON code uglier. Maybe some accessors (inline or as preprocessor macros) could be used to to wrap the JSON value structs.

(An anonymous union also occurs in libnatpmp's natpmpresp_t, I'll contact them about that.)

Attachments (1)

transmission-sunpro.diff (4.3 KB) - added by trisk 8 years ago.

Download all attachments as: .zip

Change History (9)

Changed 8 years ago by trisk

comment:1 Changed 8 years ago by trisk

Forgot to mention, the patch also fixes a void function attempting to return a value.

comment:2 Changed 8 years ago by charles

  • Owner set to charles
  • Status changed from new to assigned

torrent.c fixed in r5954

comment:3 Changed 8 years ago by charles

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

trisk: the JSON_parser code needs to be submitted upstream to Jean Gressmann (jean@…), the author of the parser. He's been responsive when I've submitted patches to him before.

As mentioned in the previous comment, the torrent.c piece is fixed in r5954. So what remains is:

  • a new version of miniupnp from Thomas Bernard
  • a new JSON_parser from Jean Gressmann

comment:4 Changed 8 years ago by charles

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:5 Changed 8 years ago by charles

The new JSON_parser's in r5969 now. All that's left is the natpmp code. :)

comment:6 Changed 8 years ago by charles

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

The natpmp update is in r5970.

Please open a new ticket when your getgateway() patch to libnatpmp is accepted upstream :)

comment:7 Changed 8 years ago by charles

  • Milestone changed from 1.30 to 1.22

comment:8 Changed 8 years ago by charles

backported to 1.2x in r6181.

Note: See TracTickets for help on using tickets.