This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: microblaze getchar() not functioning properly


On 07/27/2011 04:57 AM, naga raj wrote:
Hi Andrew,

Thanks for you reply. I am sorry I forgot to add j++ while posting.

Before posting code to gcc-help, please make sure that it is the code that shows the problem. It wastes everyone's time to look at code which you didn't test and which doesn't show the problem you want help with.

> I tried to print variable 'j' after getchar() function in code. Then
> for each character I enter 'j' value is incremented by two.

Post the code which actually failed, after you have verified the failure.

Look at the assembly generated by gcc. Where is j incremented?

Why do you think that this is a problem in getchar()?

Does the test case fail (i.e., increment j twice) without getchar()?


-- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]