view test/simp.c @ 935:7672a37e7545 default tip

Raspbery PI ARM support begin
author kono
date Sat, 24 Dec 2016 03:02:57 +0000
parents 5313ed059cee
children
line wrap: on
line source

// #include "stdio.h"
extern int printf(const char *,...);

// #define UNDECL

long long q = 122;

void
main5()
{
    long long *p;
    int r[10];
    double d;

    p = (long long *)&r;
    *p = q;

    d= (double)(*(long long*)&r);

    printf("#0019:%lld %g\n",*p,d);
}


float f = 3;
float g = 4096.0f;

int kk = {-3};

int
main2(int i)
{
    i+=f;
    return +i;
}

int
alpha(c)
char c;
{
     return(('a'<=c&&c<='z')||('A'<=c&&c<='Z')||c=='_');
}
char ch;

void main1();
int main0() ;

int
main(int ac,char *av[]) 
{
    int i;

    printf("#0051:%d\n",ac);
    for(i=0;i<ac;i++) {
        printf("#0053:%s\n",&av[i][3]);
    }
    ch = 'E';
    main1(-8);
    printf("#0057:%d\n",main2(3));
#ifdef UNDECL
    j = k;   // undeclared global variable
    printf("#0060:%d\n",h);
#endif
    main5();
    return main0(ac,ch,av);
}

int
main0(ac,ch,av) 
int ac;
char ch;
char *av[];
{
    int i;
    printf("#0073:%d %c\n",ac,ch);
    for(i=0;i<ac;i++) {
        printf("#0075:%s\n",&av[i][3]);
    }
    printf("#0077:%d==1\n",alpha(ch));
    return 0;
}

void
main1(int l)
{
   printf("#0084:%d\n", ((l+0)<-511||(l+0)>511));
   if ((l+0)<-511||(l+0)>511) printf("#0085:yes\n");
   l = -1;
   printf("#0087:%d\n", l==-1? 555:333);
}