Project

General

Profile

Bug #10364

vnode: cast between incompatible function types

Added by Toomas Soome 10 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
2019-02-10
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Issue from gcc 8 build:

    ../../common/fs/vnode.c:306:6: error: cast between incompatible function types from 'void (*)(vnode_t *, int,  caller_context_t *)' {aka 'void (*)(struct vnode *, int,  struct caller_context *)'} to 'int (*)()' [-Werror=cast-function-type]
          (fs_generic_func_p) fs_rwunlock,
          ^
    ../../common/fs/vnode.c:307:6: error: cast between incompatible function types from 'void (*)(vnode_t *, int,  caller_context_t *)' {aka 'void (*)(struct vnode *, int,  struct caller_context *)'} to 'int (*)()' [-Werror=cast-function-type]
          (fs_generic_func_p) fs_rwunlock, /* no errors allowed */
          ^
    ../../common/fs/vnode.c:357:6: error: cast between incompatible function types from 'void (*)(struct vnode *, page_t *, int,  int,  struct cred *, caller_context_t *)' {aka 'void (*)(struct vnode *, struct page *, int,  int,  struct cred *, struct caller_context *)'} to 'int (*)()' [-Werror=cast-function-type]
          (fs_generic_func_p) fs_dispose,
          ^
    ../../common/fs/vnode.c:358:6: error: cast between incompatible function types from 'void (*)(struct vnode *, page_t *, int,  int,  struct cred *, caller_context_t *)' {aka 'void (*)(struct vnode *, struct page *, int,  int,  struct cred *, struct caller_context *)'} to 'int (*)()' [-Werror=cast-function-type]
          (fs_generic_func_p) fs_nodispose,
          ^
    cc1: all warnings being treated as errors

Somehow it felt the cast through uintptr_t is more proper there..

History

#1

Updated by Electric Monk 10 months ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit 0333c43738b2582094bb2644c0a1f4211751447b

commit  0333c43738b2582094bb2644c0a1f4211751447b
Author: Toomas Soome <tsoome@me.com>
Date:   2019-02-20T21:54:42.000Z

    10364 vnode: cast between incompatible function types
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Aurélien Larcher  <aurelien.larcher@gmail.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF