Project

General

Profile

Actions

Bug #2242

closed

Bug #1450: Illumos should be buildable with GCC4

libraries should be more careful casting pointers

Added by Rich Lowe over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2012-03-05
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Yet more on the general theme: "GCC is fussy about pointer casting". I know you're excited!

There's a handful of places in libraries where we have to be mildly more careful, or to convince the compiler we are careful.

In libc_db we cast from pointer to caddr32_t, correctly, but because of the truncation need to do so via an integer type to appease the compiler.

In libtsol we cast DOOR_COOKIE to door_ptr_t, which is forcibly 64bit regardless of platform, and need to cast to avoid any potential for extension.

In the perl Kstat module we hide our own function pointers in perl IVs, such that we can use perl hash tables to map raw kstats to functions which interpret them, rather than implementing them. These IVs appear to be always greater than or equal to pointer size, and we must cast to avoid extension when "greater than", but the specifics of the perl configuration are alien to me.

Actions

Also available in: Atom PDF