Project

General

Profile

Actions

Bug #13660

closed

stackalign: cast between incompatible function types

Added by Toomas Soome about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tests
Start date:
Due date:
% Done:

100%

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

Description

Build errors with gcc 10:

    stackalign.c: In function 'main':
    stackalign.c:106:6: error: cast between incompatible function types from 'void (*)(test_ctx_t *)' {aka 'void (*)(struct test_ctx *)'} to 'void * (*)(void *)' [-Werror=cast-function-type]
      106 |      (void *(*)(void *))get_stack_at_entry, &arg) != 0) {
          |      ^
    stackalign.c:114:26: error: cast between incompatible function types from 'void (*)(test_ctx_t *)' {aka 'void (*)(struct test_ctx *)'} to 'void * (*)(void *)' [-Werror=cast-function-type]
      114 |  if (thr_create(NULL, 0, (void *(*)(void *))get_stack_at_entry,
          |                          ^
    stackalign.c:145:6: error: cast between incompatible function types from 'void (*)(test_ctx_t *)' {aka 'void (*)(struct test_ctx *)'} to 'void (*)(void *, char *, size_t,  door_desc_t *, uint_t)' {aka 'void (*)(void *, char *, long unsigned int,  struct door_desc *, unsigned int)'} [-Werror=cast-function-type]
      145 |      (door_server_procedure_t *)get_stack_at_entry,
          |      ^
    cc1: all warnings being treated as errors

Since this test is specifically built to have minimal footprint, we will not use wrappers, but cast over uintptr_t to silence the compiler.

Testing done: build/install/boot + run the stackalign tests.

Actions #1

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 1362
Actions #2

Updated by Toomas Soome about 1 year ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk about 1 year ago

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

git commit 3307fc5b1f2f4445f00811b556ab80d50467262a

commit  3307fc5b1f2f4445f00811b556ab80d50467262a
Author: Toomas Soome <tsoome@me.com>
Date:   2021-03-26T07:26:28.000Z

    13660 stackalign: cast between incompatible function types
    Reviewed by: Matt Barden <mbarden@tintri.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF