Skip to content

Conversation

@ppisar
Copy link

@ppisar ppisar commented Feb 11, 2025

A build failed with GCC 15 because that compiler moved to ISO C23 langauge version:

misc.h:32:25: error: ‘bool’ cannot be used here
   32 | char *on_off PROTO((int bool));
  |                         ^~~~

The cause is that ISO C23 added "bool" type. This patchs changes the argument name to match the function definitions.

attributes.c: In function ‘add_attribute’:
attributes.c:552:39: error: passing argument 3 of ‘dl_list_default’ from incompatible pointer type [-Wincompatible-pointer-types]
  552 |     dl_list_default(attr_list, FALSE, destroy_attr_data);
  |                                       ^~~~~~~~~~~~~~~~~
  |                                       |
  |                                       int (*)(attribute_struct *) {aka int (*)(struct _attribute_struct *)}
In file included from attributes.h:15,
	     from attributes.c:10:
dl_list.h:44:34: note: expected ‘int (*)(void)’ but argument is of type ‘int (*)(attribute_struct *)’ {aka ‘int (*)(struct _attribute_struct *)’}
   44 |                            int (*destroy_data)()));
  |                            ~~~~~~^~~~~~~~~~~~~~~

ISO C23 changed meaning of "int foo()" to "int foo(void)". This patch addapts to it.

A build failed with GCC 15 because that compiler moved to ISO C23 langauge version:

    misc.h:32:25: error: ‘bool’ cannot be used here
       32 | char *on_off PROTO((int bool));
	  |                         ^~~~

The cause is that ISO C23 added "bool" type. This patchs changes the argument
name to match the function definitions.

    attributes.c: In function ‘add_attribute’:
    attributes.c:552:39: error: passing argument 3 of ‘dl_list_default’ from incompatible pointer type [-Wincompatible-pointer-types]
      552 |     dl_list_default(attr_list, FALSE, destroy_attr_data);
	  |                                       ^~~~~~~~~~~~~~~~~
	  |                                       |
	  |                                       int (*)(attribute_struct *) {aka int (*)(struct _attribute_struct *)}
    In file included from attributes.h:15,
		     from attributes.c:10:
    dl_list.h:44:34: note: expected ‘int (*)(void)’ but argument is of type ‘int (*)(attribute_struct *)’ {aka ‘int (*)(struct _attribute_struct *)’}
       44 |                            int (*destroy_data)()));
	  |                            ~~~~~~^~~~~~~~~~~~~~~

ISO C23 changed meaning of "int foo()" to "int foo(void)". This patch
addapts to it.

Signed-off-by: Petr Písař <ppisar@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant