On Mon, 20 Nov 2006, Carl Denk wrote: > Adding "(const far rom char *)" and here's what it looks > like now: printf ((const far rom char *) " Hello = %5d \n\r ", c ); > and making both code and data models are set to large, seems to have > cured that. Sounds like I don't need large, and I didn't think I was > that big, the hex file is less than 2k hex. And that grew alot when I > introduced floating point arithmetic with ADC conversion to real > numbers. If needed I could make that all integer with a little work. > Then if I go back to small memory models, I have another issue to solve > with the printf and variable declarations. The cast will suppress the warning if you switch back to small memory model. > Guess I'll never understand > why a printf of a constant string needs any declaration, and the > compiler doesn't handle it. It's a limitation in C18's design. There's really no "right" fix for it; you just have to use the kludgy workarounds suggested in the manual. > John Temples wrote: >> What PIC are you using? Large memory model is for PICs with more than >> 64K of program memory. The fact that you got a "type qualifier >> mismatch" warning doesn't mean you're using the wrong memory model. >> >> On Mon, 20 Nov 2006, Carl Denk wrote: >> >> >>> First let me thank those that responded. The "\n\r" outside the " was a >>> typo, but I think what got me in trouble was the memory models. My >>> thinking is that as the code grew, initially it was within the "small" >>> model criteria, but as I added to the code, the boundary was crossed >>> without warning. I had been aware of the memory model settings, but had >>> over a period of time (month or 2, not years) overlooked the setting the >>> memory model. Probably copied the "C" file to save the current working >>> file and started a new project before moving on. >>> >>> >>> 1: Is there a way to set defaults for MPLAB so the memory model and >>> other items would always come up large when starting a new project? >>> >>> 2: Do other IDE's have similar issue of code model sizes? It would seem >>> that along with all the other parameters that are set when selecting a >>> target, this could be set also. What happened to "C" when ROM, Far, >>> Near, etc. wasn't needed for simple programs. I'm just a hobbiest, but >>> working on a real needed project (our house heating reliably this winter >>> depends on it). Don't mind spending a few dollars, but not 100's on >>> software. I guess I'm showing my age, but I still have a Manx C compiler >>> for 8086. >>> >>> ps: When referring to a manual, would be nice to have a key word or to >>> to narrow the search. >>> >>> Thanks again. :) >>> >>> John Temples wrote: >>> >>>> On Sun, 19 Nov 2006, Carl Denk wrote: >>>> >>>> >>>> >>>>> just adding the following line to a simple C file >>>>> >>>>> printf( "Hello" \n\r ); >>>>> >>>>> >>>> Is that what you really added? That isn't valid C. >>>> >>>> >>>> >>>>> generates the following error: >>>>> >>>>> HANDSHAKE-1.C:27:Warning [2066] type qualifier mismatch in assignment >>>>> >>>>> >>>> This is discussed in the "Getting Started" manual that came with the >>>> compiler. >>>> >>>> -- >>>> John W. Temples, III -- John W. Temples, III -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist