Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6379 closed defect (fixed)

ignored return value warnings in OpenBSD_malloc

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

Description

OpenBSD_malloc_Linux.c: In function 'wrterror':
OpenBSD_malloc_Linux.c:459: error: ignoring return value of 'writev', declared with attribute warn_unused_result
OpenBSD_malloc_Linux.c: In function 'wrtwarning':
OpenBSD_malloc_Linux.c:493: error: ignoring return value of 'writev', declared with attribute warn_unused_result
OpenBSD_malloc_Linux.c: In function 'memalign':
OpenBSD_malloc_Linux.c:2008: error: ignoring return value of 'posix_memalign', declared with attribute warn_unused_result
OpenBSD_malloc_Linux.c: In function 'valloc':
OpenBSD_malloc_Linux.c:2015: error: ignoring return value of 'posix_memalign', declared with attribute warn_unused_result

when configured with

./configure --disable-asciidoc --with-libevent-dir=/home/karsten/libs/ --with-openssl-dir=/home/karsten/libs --with-zlib-dir=/home/karsten/libs --enable-static-openssl --enable-static-libevent --enable-gcc-warnings --enable-openbsd-malloc

Child Tickets

Change History (7)

comment:1 Changed 7 years ago by Sebastian

Component: - Select a componentTor Client
Milestone: Tor: 0.2.4.x-final

Sorry, this is on master

comment:2 Changed 7 years ago by Sebastian

Milestone: Tor: 0.2.4.x-finalTor: 0.2.3.x-final

Also affects 0.2.3

comment:3 Changed 7 years ago by nickm

For our uses, I believe we could just "#if 0" out the functions using posix_memalign entirely: we don't use those functions in Tor.

The writev ones are for last-minute error reporting, so we can't do much more on an error than ignore it. So for them, we could add a cast to void to suppress the warning.

comment:4 Changed 7 years ago by nickm

Status: newneeds_review

I think I have a fix in branch "bug6379" in my public repository. Please review and test?

comment:5 Changed 7 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Okay, I guess I can review and test too.

It worked fine on my osx and my linux. If if doesn't work on your linux, please reopen. Merging this into 0.2.3.

comment:6 Changed 7 years ago by nickm

Keywords: tor-client added

comment:7 Changed 7 years ago by nickm

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