Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Frisky
PostPosted: May 22, 2012 - 03:03 AM
Rookie


Joined: Sep 29, 2002
Posts: 31
Location: Chicago,Il USA

I'm using WinAVR with Programmer's Notepad how can I select Warning are errors mode. Would it be an option in the make file?
Thanks
Don
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: May 22, 2012 - 03:50 AM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

I'm not familiar with Programmers Notepad but if the makefile calls avr-gcc.exe then just add -Werror to the line that invokes the compiler.

It's probably better if you can post the makefile, or the lines that call avr-gcc.exe, just to check.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: May 22, 2012 - 08:58 AM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18554
Location: Lund, Sweden

Quote:

I'm using WinAVR with Programmer's Notepad how can I select Warning are errors mode. Would it be an option in the make file?

Yes.

Details depends on the makefile you use.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Torby
PostPosted: May 28, 2012 - 04:58 PM
Raving lunatic


Joined: Nov 11, 2003
Posts: 3882
Location: Chicago Illinois USA

Now I'm trying to put the array of pointers in progmem:

Code:


const char Scale0[] PROGMEM = "1:20.3";
const char Scale1[] PROGMEM = "1:22";
const char Scale2[] PROGMEM = "1:24";
const char Scale3[] PROGMEM = "1:29";
const char Scale4[] PROGMEM = "1:32";
char* ScaleText [] PROGMEM = { Scale0, Scale1, Scale2, Scale3, Scale4};


But the compiler says ScaleText has to be constant. So I add const:

Code:


const char Scale0[] PROGMEM = "1:20.3";
const char Scale1[] PROGMEM = "1:22";
const char Scale2[] PROGMEM = "1:24";
const char Scale3[] PROGMEM = "1:29";
const char Scale4[] PROGMEM = "1:32";
const char* ScaleText [] PROGMEM = { Scale0, Scale1, Scale2, Scale3, Scale4};


But winavr still complains that ScaleText has to be constant to put in program memory. I tried telling it, but it just doesn't understand me.

Off to Memorializing activities with me! I'm the first disqualified of a long line of army veterans. (After I get the code tags right.)

_________________
Discursive design,

Torby

Some days, it's just not worth chewing through the restraints.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
wek
PostPosted: May 28, 2012 - 05:01 PM
Raving lunatic


Joined: Dec 16, 2005
Posts: 3087
Location: Bratislava, Slovakia

Code:
const char* const ScaleText [] PROGMEM = { Scale0, Scale1, Scale2, Scale3, Scale4};

The first const says, you are pointing to a variable which is not going to change. The second const says that the pointer is not going to change either.

JW
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
JohanEkdahl
PostPosted: May 28, 2012 - 05:21 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18554
Location: Lund, Sweden

Put
explain const char* const ScaleText []
into a Cdecl online server.

Then play around a bit, remove and add "const" at different places.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
wek
PostPosted: May 28, 2012 - 05:32 PM
Raving lunatic


Joined: Dec 16, 2005
Posts: 3087
Location: Bratislava, Slovakia

JohanEkdahl wrote:
I am not the only C-Hater, then?

JW
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larryvc
PostPosted: May 28, 2012 - 05:34 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

JohanEkdahl wrote:
Put
explain const char* const ScaleText []
into a Cdecl online server.

Then play around a bit, remove and add "const" at different places.

Wow, Johan, you've given me a tool I didn't know about. Thank you for this post. Smile

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: May 28, 2012 - 05:49 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18554
Location: Lund, Sweden

Chances are you actually have a commald-line based cdecl on your hard drive..
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larryvc
PostPosted: May 28, 2012 - 06:16 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

JohanEkdahl wrote:
Chances are you actually have a commald-line based cdecl on your hard drive..

Maybe in one of my linux VMs, not on any of my hard drives and there is a ton of historic, read "very old and useless", stuff there. Is there a version that will run from from the command line or powershell that is compatible with Win7, or do I need cygwin or something like that?

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
sternst
PostPosted: May 28, 2012 - 06:23 PM
Raving lunatic


Joined: Jul 23, 2001
Posts: 2438
Location: Osnabrueck, Germany

larryvc wrote:
Wow, Johan, you've given me a tool I didn't know about. Thank you for this post. Smile
But keep in mind that it is not always correct.
E.g.
int volatile i; -> syntax error

_________________
Stefan Ernst
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: May 28, 2012 - 07:07 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

sternst wrote:
But keep in mind that it is not always correct.
E.g.
int volatile i; -> syntax error

But it does work as this:

volatile int i; -> declare i as volatile int

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
sternst
PostPosted: May 28, 2012 - 07:25 PM
Raving lunatic


Joined: Jul 23, 2001
Posts: 2438
Location: Osnabrueck, Germany

larryvc wrote:
But it does work as this:

volatile int i; -> declare i as volatile int
So what? That does not change the fact that the response to "int volatile i;" is wrong.

_________________
Stefan Ernst
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: May 28, 2012 - 07:51 PM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18554
Location: Lund, Sweden

Quote:

Maybe in one of my linux VMs

Darn, I had a clear memory of that it actually came with the WinAVR installation, but no..

Then it must have been that I downloaded the source and built it. In Visual Studio. (I.e. no CygWin, no MinGW).
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
snigelen
PostPosted: May 28, 2012 - 08:04 PM
Posting Freak


Joined: Jan 08, 2009
Posts: 1153
Location: Lund, Sweden

As clawson said recently,
Code:
sudo apt-get install cutils
if you're using something like debian or ubuntu.
 
 View user's profile Send private message  
Reply with quote Back to top
larryvc
PostPosted: May 28, 2012 - 08:14 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

Yeah, I was looking for one in windows as mentioned above.

Thanks anyways. Smile

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
snigelen
PostPosted: May 28, 2012 - 08:24 PM
Posting Freak


Joined: Jan 08, 2009
Posts: 1153
Location: Lund, Sweden

Yes, I realize that now, I read too fast,
Quote:
Maybe in one of my linux VMs
I thought that meant that you looked there and didn't find it. I now see that you probably meant "It may be there, but I want a Windows version".
 
 View user's profile Send private message  
Reply with quote Back to top
Torby
PostPosted: May 29, 2012 - 12:17 AM
Raving lunatic


Joined: Nov 11, 2003
Posts: 3882
Location: Chicago Illinois USA

Wow, at the speed of light, from far away Slovakia, the answer comes while I'm out playing with trains in a beautiful garden. Now the compiler is happy. Wonder if the silly program works. Oh, still need to....

(I'm not really hot on C either, but the world abandoned Pascal and Modula years ago.)

_________________
Discursive design,

Torby

Some days, it's just not worth chewing through the restraints.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
larryvc
PostPosted: May 30, 2012 - 07:28 PM
Raving lunatic


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA

sternst wrote:
larryvc wrote:
But it does work as this:

volatile int i; -> declare i as volatile int
So what? That does not change the fact that the response to "int volatile i;" is wrong.

Sorry Stefan, I missed this.

I really meant to say that it worked for one and not the other. I was not questioning your statement above as I agree with it.

_________________
Larry

Those afraid to embrace the future will quickly fade into the past. - larryvc
 
 View user's profile Send private message  
Reply with quote Back to top
Torby
PostPosted: May 31, 2012 - 02:47 PM
Raving lunatic


Joined: Nov 11, 2003
Posts: 3882
Location: Chicago Illinois USA

No! I don't want to read this! I'll be putting "volatile" in the wrong place for the rest of my life!

_________________
Discursive design,

Torby

Some days, it's just not worth chewing through the restraints.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits