Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#4618 closed defect (fixed)

Compiler warnings in transports.c

Reported by: sjmurdoch Owned by:
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


In b5a306e82c684bdd30b832fdfd9e2b55c06b54ae, building on Windows using gcc 4.6.1 (from mingw32), transports.c flags up some compiler errors.

Does the environ global exist on Windows?

The second problem looks reasonably straight forward.

transports.c: In function 'set_managed_proxy_environment':
transports.c:948:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
transports.c:948:3: error: nested extern declaration of '__p__environ' [-Werror=nested-externs]
transports.c:948:17: error: redundant redeclaration of '__p__environ' [-Werror=redundant-decls]
c:\mingw\bin\../lib/gcc/mingw32/4.6.1/../../../../include/stdlib.h:149:51: note: previous declaration of '__p__environ' was here
transports.c:1024:9: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith]
transports.c:1026:9: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith]
cc1.exe: all warnings being treated as errors

Child Tickets

Change History (6)

comment:1 Changed 9 years ago by nickm

According to msdn, I think "_environ" is supposed to exist, as is "environ" (maybe). The trick is how they're defined. Looking in mingw's stdlib.h, I get this possibility:

# define _environ (*__p__environ())

So doing a second declaration is going to be a mess. What happens if you just take out that declaration entirely?

As for the second one, it does indeed look like that should be a char*.

comment:2 Changed 9 years ago by nickm

Milestone: Tor: 0.2.3.x-final

comment:3 Changed 9 years ago by ln5

Status: newneeds_review

Branch bug4618 in my repo fixes these issues for me.

comment:4 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

merged; thanks!

comment:5 Changed 8 years ago by nickm

Keywords: tor-relay added

comment:6 Changed 8 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.