Skip to content

Conversation

@protoben
Copy link

@protoben protoben commented Jan 19, 2023

When trying to build the picoserver example on x86_64 from the CAmkES repo, I ran into the following compiler error:

/home/user/camkes-manifest/projects/global-components/components/Ethdriver/src/ethdriver.c:111:14: error: conflicting types for 'clie
nt_enumerate_badge'; have 'unsigned int(unsigned int)'
  111 | unsigned int client_enumerate_badge(unsigned int i);
      |              ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/user/camkes-manifest/picoserver/ethdriver/include/camkes.h:4,
                 from /home/user/camkes-manifest/projects/global-components/components/Ethdriver/src/ethdriver.c:11:
/home/user/camkes-manifest/picoserver/ethdriver/include/client_seL4Ethdriver_0.h:18:11: note: previous declaration of 'client_enumera
te_badge' with type 'seL4_Word(unsigned int)' {aka 'long unsigned int(unsigned int)'}
   18 | seL4_Word client_enumerate_badge(unsigned int i);
      |           ^~~~~~~~~~~~~~~~~~~~~~
/home/user/camkes-manifest/projects/global-components/components/Ethdriver/src/ethdriver.c:112:7: error: conflicting types for 'clien
t_buf'; have 'void *(unsigned int)'
  112 | void *client_buf(unsigned int client_id);
      |       ^~~~~~~~~~
In file included from /home/user/camkes-manifest/picoserver/ethdriver/include/camkes.h:4,
                 from /home/user/camkes-manifest/projects/global-components/components/Ethdriver/src/ethdriver.c:11:
/home/user/camkes-manifest/picoserver/ethdriver/include/client_seL4Ethdriver_0.h:15:8: note: previous declaration of 'client_buf' wit
h type 'void *(seL4_Word)' {aka 'void *(long unsigned int)'}
   15 | void * client_buf(seL4_Word client_id);
      |        ^~~~~~~~~~

The problem seems to be with the Ethdriver component using unsigned int in type signatures, rather than seL4_Word. This branch changes Ethdriver to use seL4_Word, so that it compiles.

Signed-off-by: Ben Hamlin <hamlinb@galois.com>
@axel-h
Copy link
Member

axel-h commented Jan 19, 2023

Since the error says that there is a conflict with the prototypes from client_seL4Ethdriver_0.h, I wonder if it would make more sense to completely remove the prototypes from ethdriver.c then. They should be taken from the header files, because this is the place where the interface is defined (and maintained).

@protoben protoben changed the title Update function signatures to use seL4_Word Ethdriver: Update function signatures to use seL4_Word Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants