[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Passing a string variable to lcd_puts

From: Graham Davies
Subject: Re: [avr-gcc-list] Passing a string variable to lcd_puts
Date: Fri, 27 Mar 2009 17:02:04 -0400

David VanHorn wrote:
"... the unspecified variant looks like a disaster waiting to happen ...".
I don't disagree.
And: "... using the portable types, there does not appear to be an unspecified char ..."
Maybe that's why they're "portable".  I'm not sure that's the right name for them, though.  I tend to call them "fixed-length integer types".
And: "I don't want to cast aspersions, but it seems to me like lcd_puts is buggy, if it's requiring sign."
I would agree that it's "buggy" in that it wasn't written with the same care that you're excercising, but you'll find an awful lot of that and the authors won't generally agree that it's "buggy".
When you say "cast aspersions", are you making a pun?  The solution that I would recommend for this problem is to use an explicit cast of the variable from your (well-chosen) type to the type the author of the function has used for the formal argument.  Anyone reading the code should be able to see what the cast is for so this will self-document.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]