Project

General

Profile

Actions

Bug #6361

closed

NULL pointer constant issues with timerfd

Added by Richard PALO about 6 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-10-19
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

sigh, please see attached patch that fixes the following with an appropriate NULL definition:

==== Build errors (DEBUG) ====

../../common/io/timerfd.c:125: error: return makes integer from pointer without 
a cast
../../common/io/timerfd.c:334: error: comparison between pointer and integer
../../common/io/timerfd.c:376: error: comparison between pointer and integer
../../common/io/timerfd.c:458: error: passing argument 6 of 'ddi_create_minor_no
de' makes integer from pointer without a cast
dmake: Warning: Command failed for target `debug64/timerfd.o'
dmake: Warning: Target `install.targ' not remade because of errors
The following command caused the error:
../../common/io/timerfd.c:125: error: return makes integer from pointer without 
a cast
../../common/io/timerfd.c:334: error: comparison between pointer and integer
../../common/io/timerfd.c:376: error: comparison between pointer and integer
../../common/io/timerfd.c:458: error: passing argument 6 of 'ddi_create_minor_no
de' makes integer from pointer without a cast
dmake: Warning: Command failed for target `debug32/timerfd.o'
dmake: Warning: Target `install.targ' not remade because of errors
The following command caused the error:
dmake: Warning: Target `install' not remade because of errors
dmake: Warning: Command failed for target `timerfd'
dmake: Warning: Target `install' not remade because of errors
dmake: Warning: Command failed for target `intel'
dmake: Warning: Target `install' not remade because of errors
dmake: Warning: Command failed for target `uts'
dmake: Warning: Target `_msg' not remade because of errors


Files

Actions #1

Updated by Gary Mills about 6 years ago

In the two lines with a comparison, you could also use:

if (st.tfd_settime_ovalue != 0)

because tfd_settime_ovalue is type uint64_t, an integer type.

Actions #2

Updated by Richard PALO about 6 years ago

Gary Mills wrote:

In the two lines with a comparison, you could also use:

[...]

because tfd_settime_ovalue is type uint64_t, an integer type.

Yes, but they are clearly defined as pointer types:


49typedef struct timerfd_settime {
50    uint64_t tfd_settime_flags;    /* flags (e.g., TFD_TIMER_ABSTIME) */
51    uint64_t tfd_settime_value;    /* pointer to value */
52    uint64_t tfd_settime_ovalue;    /* pointer to old value, if any */
53} timerfd_settime_t;

keeping in mind 7.18.1.4 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf), naturally

take a look at timerfd_settime (which sort of overdoes it, though)

Actions #3

Updated by Robert Mustacchi about 1 year ago

  • Status changed from New to Closed

All the outstanding NULL pointer vs int issues have been cleaned up for x86 and SPARC as of #12661.

Actions

Also available in: Atom PDF