Mercurial > hg > CbC > CbC_examples
changeset 28:51f8521bc5d1
remove warnings
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 23 May 2020 07:31:02 +0900 |
parents | 586096c45873 |
children | a94136a6edb2 |
files | stack1.c test05.c test_cs.c test_para3.c test_para4.c test_tree.c |
diffstat | 6 files changed, 18 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/stack1.c Sat May 23 07:19:57 2020 +0900 +++ b/stack1.c Sat May 23 07:31:02 2020 +0900 @@ -3,7 +3,9 @@ */ #include <stdio.h> -#define NULL 0 +#include <stdlib.h> + +// #define NULL 0 extern int printf(const char*, ...); extern void *malloc(size_t); @@ -30,7 +32,7 @@ goto (* ((struct cont_save *)sp)->ret)(i+4,sp); } -__code __attribute__ ((fastcall)) f_g1(int j,void *sp) { /* Continuation */ +__code f_g1(int j,void *sp) { /* Continuation */ int k; struct f_g0_save *c; @@ -98,6 +100,8 @@ goto print(i,j,exit2,exit2env); } +int main0( int ac, char *av[]); + int main(int ac, char*av[]){ main0(ac,av); }
--- a/test05.c Sat May 23 07:19:57 2020 +0900 +++ b/test05.c Sat May 23 07:31:02 2020 +0900 @@ -1,4 +1,6 @@ //#include<stdio.h> +#include <stdlib.h> + extern int printf(const char*, ...); #define dprint(f, args...) \ printf("in %s: "f, __FUNCTION__, ## args)
--- a/test_cs.c Sat May 23 07:19:57 2020 +0900 +++ b/test_cs.c Sat May 23 07:31:02 2020 +0900 @@ -2,6 +2,7 @@ //#include<stdlib.h> extern int printf(const char*, ...); +extern void exit(int status); __code cs_exit(int , double , char ); __code cs1(int, int, int, int);
--- a/test_para3.c Sat May 23 07:19:57 2020 +0900 +++ b/test_para3.c Sat May 23 07:31:02 2020 +0900 @@ -49,9 +49,9 @@ int function(){ struct abc A; struct def B; - A.a = 10, A.b = 20.02, A.c = '\0', A.d = 0xad; - B.d = 30, B.f = 0xbf; - B.e.a = 50, B.e.b = 60.06, B.e.c = '\1', B.e.d = 0xed; + A.a = 10, A.b = 20.02, A.c = '\0', A.d = (void*)0xad; + B.d = 30, B.f = (void*)0xbf; + B.e.a = 50, B.e.b = 60.06, B.e.c = '\1', B.e.d = (void*)0xed; printf("function :\n"); print_abc(A); @@ -65,9 +65,9 @@ struct abc A; struct def B; //int a=10, b=20, c=30, d=40, e=50, f=60, g=70; - A.a = 10, A.b = 20.02, A.c = '\0', A.d = 0xad; - B.d = 30, B.f = 0xbf; - B.e.a = 50, B.e.b = 60.06, B.e.c = '\1', B.e.d = 0xed; + A.a = 10, A.b = 20.02, A.c = '\0', A.d = (void*)0xad; + B.d = 30, B.f = (void*)0xbf; + B.e.a = 50, B.e.b = 60.06, B.e.c = '\1', B.e.d = (void*)0xed; /* printf("main :\n");
--- a/test_para4.c Sat May 23 07:19:57 2020 +0900 +++ b/test_para4.c Sat May 23 07:31:02 2020 +0900 @@ -2,6 +2,7 @@ //#include<stdlib.h> extern int printf(const char*, ...); +extern void exit(int status); #define DPRINT 1 #define NOINLINE __attribute__((noinline))
--- a/test_tree.c Sat May 23 07:19:57 2020 +0900 +++ b/test_tree.c Sat May 23 07:31:02 2020 +0900 @@ -5,6 +5,8 @@ __code cs(int , double , char ); void testvoid(double a); int testint(double a); +void test_goto(int a, int b, double c); +__code test_goto1(int a, int b, double c); __code cs(int a, double b, char c){ printf("__code cs was called.\n");