Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fix build warning.

The prototype function pointer is "struct base *" so the overridden function
should use the same type.

This fixes the following warning.
c-inheritance.c:39:3: warning: initialization from incompatible pointer type
c-inheritance.c:40:3: warning: initialization from incompatible pointer type
  • Loading branch information...
commit 416eb83ac6100718d7bc4b8bbaf1eabf733fdeb9 1 parent 5223446
@tfarina authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 c-inheritance.c
4 c-inheritance.c
@@ -27,11 +27,11 @@ struct derived {
int bar;
-static void derived_dance(struct derived *d) {
+static void derived_dance(struct base *d) {
printf("derived_dance called!\n");
-static void derived_jump(struct derived *d, int how_high) {
+static void derived_jump(struct base *d, int how_high) {
printf("derived_jump called!\n");

0 comments on commit 416eb83

Please sign in to comment.
Something went wrong with that request. Please try again.