Permalink
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...
1 parent 5223446 commit 416eb83ac6100718d7bc4b8bbaf1eabf733fdeb9 @tfarina committed Feb 3, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 c-inheritance.c
View
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.