robinfawell Posted November 30, 2006 Report Share Posted November 30, 2006 I keep getting the following warning after compiling.Warning; need to allocate new register by name. I have had this warning in the past and have ignored it. Can anyone help?Regards RobinThere is a sequel to this warning. In the past I ignored Compiler Warnings. In this case the for loop fails to work for some reason. The code looks OK. Quote Link to comment Share on other sites More sharing options...
jackchaos Posted November 30, 2006 Report Share Posted November 30, 2006 RobinCan you paste the code where you think is causing the error?Can you paste the output including the error after running make.bat? Quote Link to comment Share on other sites More sharing options...
robinfawell Posted December 1, 2006 Author Report Share Posted December 1, 2006 As before, the warning has now disappeared. The name the warning was referring to was a function.I cannot now send you the full message. I tried the sdcc website but could not find anything. Thanks Robin Quote Link to comment Share on other sites More sharing options...
robinfawell Posted December 2, 2006 Author Report Share Posted December 2, 2006 It has happened again. This time I know the circumstances.I am trying to minimise my code by introducing a for loop. (see below). As soon as I compiled I received the following warning.There is a sequel to this warning. In the past I ignored Compiler Warnings. In this case the for loop fails to work for some reason. The code looks OK. RobinMicrosoft Windows XP [Version 5.1.2600]© Copyright 1985-2001 Microsoft Corp.C:\C_Stops>makeMakefile generated.Makefile.bat generated.Assembling MIOS SDCC wrapper==========================================================================Compiling main.cProcessor: 18F452pic16_allocRegByName:963 symbol name _ReadStoredValues_d_1_1 regop= 00D471E8gen.c:1890: WARNING: need to allocate new register by name -> _ReadStoredValues_d_1_1==========================================================================Compiling pic18f452.cProcessor: 18F452==========================================================================Linking project==========================================================================Converting to project.syxBlock 003000-0033FF allocated - Checksum: 2DBlock 003400-0037FF allocated - Checksum: 26Block 003800-003BFF allocated - Checksum: 09Block 003C00-003FFF allocated - Checksum: 7DBlock 004000-0043FF allocated - Checksum: 09Block 004400-0047FF allocated - Checksum: 34Block 004800-004BFF allocated - Checksum: 60==========================================================================SUCCESS!C:\C_Stops>///////////////////////////////////////////////////////////////////// void ReadStoredValues( unsigned char pin) //__wparam///////////////////////////////////////////////////////////////////// { unsigned char memorised_stored_pin; unsigned char d;//to increment EEprom reads q = ((pin-1)<< 5) + 10;//determines EEProm address depending on Memory pin number. for(d<=1; d>=13;d++) SendDump(MIOS_EEPROM_Read(q + d)); //SendDump(MIOS_EEPROM_Read(q + 1)); MemorisedStopsSetLed (8, 14, 15, MIOS_EEPROM_Read(q + 1));//pedal stops //SendDump(MIOS_EEPROM_Read(q + 2)); MemorisedStopsSetLed (24, 24, 25, MIOS_EEPROM_Read(q + 2));//tremelo strength //SendDump(MIOS_EEPROM_Read(q + 3)); Quote Link to comment Share on other sites More sharing options...
robinfawell Posted December 2, 2006 Author Report Share Posted December 2, 2006 Problem solved. Did anyone spot the error in the for loop? I didn't.for(d<=1; d>=13;d++)It should be for(d=1; d>=13;d++) the < before the = is the culprit.I am going to take Warnings more seriously from now on.Robin Quote Link to comment Share on other sites More sharing options...
jackchaos Posted December 2, 2006 Report Share Posted December 2, 2006 robinfawellIt's good that you were able to discover the error on your own.I've learned to compiled after just about any change, so I can correct a problem while it's still fresh in my memory.I wouldn't ignore any compiler warnings... even if the code looks to be working fine. Jumping on any warning as soon as you see it will save you a lot of time and grief later on. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.