Project

General

Profile

Bug #10159

libc: cast between incompatible function types

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2018-12-23
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Issue found by gcc 8 build:

    ../port/threads/c11_thr.c: In function 'thrd_create':
    ../port/threads/c11_thr.c:198:34: error: cast between incompatible function types from 'thrd_start_t' {aka 'int (*)(void *)'} to 'void * (*)(void *)' [-Werror=cast-function-type]
      ret = pthread_create(thr, NULL, (void *(*)(void *))func, arg);
                                      ^
    In file included from /code/illumos-gate/usr/src/lib/libc/inc/thr_uberdata.h:40,
                     from ../port/threads/pthread.c:31:
    ../port/threads/pthread.c: In function 'pthread_once':
    /code/illumos-gate/proto/root_i386/usr/include/pthread.h:167:25: error: cast between incompatible function types from 'int (*)(mutex_t *)' {aka 'int (*)(struct _lwp_mutex *)'} to 'void (*)(void *)' [-Werror=cast-function-type]
      __pthread_cleanup_push((_Voidfp)(routine), (void *)(args), \
                             ^
    ../port/threads/pthread.c:195:4: note: in expansion of macro 'pthread_cleanup_push'
        pthread_cleanup_push(mutex_unlock, &once->mlock);
        ^~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 10 months ago

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

git commit adc04c2d55dd20cc6a0622f1147c0b084cdc3099

commit  adc04c2d55dd20cc6a0622f1147c0b084cdc3099
Author: Toomas Soome <tsoome@me.com>
Date:   2019-01-04T12:35:22.000Z

    10159 libc: cast between incompatible function types
    Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>

Also available in: Atom PDF