[Prev][Next][Index]
Re: pc++ / printf problem
- From: "Beata Winnicka" <bfatyga@slab.cica.indiana.edu>
- Date: Wed, 1 Feb 95 16:34:35 -0500
- To: "Bernd W. Mohr" <mohr@cs.uoregon.edu>
- Subject: Re: pc++ / printf problem
- Cc: sage-bugs@cica.cica.indiana.edu (Sage++ Bugs Mailinglist),
nate@skinner.cs.uoregon.edu
>a student of us found the following problem:
>he has the following lines in his test.pc in Processor_Main:
>
> unsigned long i;
>
> printf ("i = %d\n");
I assume you wanted to say:
printf ("i = %d\n", i);
>NOTE the missing type for pCar_1 (which results in a C++ error).
>It works if "i" is declared "int", but not if declared "long",
>"unsigned", or "unsigned long".
I thought that if you omit a type in a function definition, then the
compiler has to make the type int (a left-over from C). So it should
not be an error (a warning, at most). Just because I am curious about
that: what kind of error message do you get?
And independent of your answer, I'll try to make the printf
conversion more robust. --Beata