Compiler warnings in jemalloc.c

RESOLVED DUPLICATE of bug 1226907

Status

()

defect
RESOLVED DUPLICATE of bug 1226907
10 years ago
4 years ago

People

(Reporter: sune, Unassigned)

Tracking

(Blocks 1 bug)

Trunk
All
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning])

Attachments

(1 attachment, 1 obsolete attachment)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; rv:1.9.1.1pre) Gecko/20090707 SeaMonkey/2.0b1pre
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; rv:1.9.1.1pre) Gecko/20090707 SeaMonkey/2.0b1pre

Compiling produces the following warnings:

jemalloc.c: In function ‘wrtmessage’:
jemalloc.c:1395: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
jemalloc.c:1396: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
jemalloc.c:1397: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
jemalloc.c:1398: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result

Reproducible: Always

Steps to Reproduce:
1. Compile
2. Watch output

Actual Results:  
Warnings

Expected Results:  
No warnings

Adding a patch, when I see how to diff correctly
Component: General → jemalloc
Product: SeaMonkey → Core
Version: unspecified → Trunk
Comment on attachment 387258 [details] [diff] [review]
Patch to use write() as it should be

You have to request review from someone
Attachment #387258 - Flags: review?(jasone)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 387258 [details] [diff] [review]
Patch to use write() as it should be

If the write(STDERR_FILENO, ...) call fails, fprintf(stderr, ...) is very likely to fail too.  See http://canonware.com/cgi-bin/hg_jemalloc/file/938eab26a83a/jemalloc/src/jemalloc.c (lines 1205-1209) for how I recently worked around this compiler warning in a different source repo.
Attachment #387258 - Flags: review?(jasone) → review+
Attachment #387258 - Attachment is obsolete: true
Attachment #387490 - Flags: review?(jasone)
Attachment #387490 - Flags: review?(jasone) → review+
Jason: can you help with bringing this patch into the tree ?
Do you know an sr for this patch ?
QA Contact: general → jemalloc
Whiteboard: [build_warning]
I fixed this mozjemalloc warnings in bug 1226907.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1226907
You need to log in before you can comment on or make changes to this bug.