Bug in Printf

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
tktech
Posts: 2
Joined: Wed Jul 23, 2008 10:16 pm

Bug in Printf

Post by tktech »

I've just finished (almost implementing printf) and the only error is:

Code: Select all

printf.c:169: error: lvalue required as left operand of assignment
the line in question is:

Code: Select all

num = va_arg(args, unsigned long);
This is my only error left, any help would be appreciated ^^
This is standard of every other printf implementation I've seen, so why is it bugging out on cc?
User avatar
stephenj
Member
Member
Posts: 140
Joined: Wed Jul 23, 2008 1:37 am
Location: Canada

Re: Bug in Printf

Post by stephenj »

tktech wrote:I've just finished (almost implementing printf) and the only error is:

Code: Select all

printf.c:169: error: lvalue required as left operand of assignment
the line in question is:

Code: Select all

num = va_arg(args, unsigned long);
The problem being reported is that "unsigned long" expects a variable to be declared such as "unsigned long x"

Other than that, you shouldn't declare a variable as it is being passed.
tktech
Posts: 2
Joined: Wed Jul 23, 2008 10:16 pm

Re: Bug in Printf

Post by tktech »

Was a woops in my macros, fixed
Post Reply