Closed Bug 502904 Opened 15 years ago Closed 8 years ago

Compiler warnings in jemalloc.c

Categories

(Core :: Memory Allocator, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1226907

People

(Reporter: sune, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

Attachments

(1 file, 1 obsolete file)

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]
Blocks: buildwarning
I fixed this mozjemalloc warnings in bug 1226907.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: