Solutions to common warnings and error messages of the Keil C Compiler

Source: Internet
Author: User

Solutions to common warnings and error messages of the Keil C Compiler

1. Warning 280: 'I': unreferenced local variable

Note that local variable I does not perform any access operations in the function
Solution: Eliminate the declaration of the I variable in the function

2 warning 206: 'music3': missing function-Prototype

It indicates that the music3 () function is not declared or is not declared externally, so it cannot be called by other functions.
The solution is to write void music3 (void) at the front end of the Program for declaration. If it is a function of another file, it must be written as extern void music3 (void), that is, external declaration.

3 compling: C:/8051/mann. c
Error: 318: Can't open file 'beep. H'

Note that during the compilation of C:/8051/mann. C program, the command # include "beep. H" is used in Main. C, but the command cannot be found.
Solution: compile a beep. h file and add it to the C:/8051 working directory.

4 compling: C:/8051/led. c
Error 237: 'leton': function already has a body

It indicates that the name of the ledon () function has two or more identical function names.
Solution: Correct a function name so that the function name is independent.

5 *** warning 16: uncalled segment, ignored for overlay Process
Segment :? PR? _ Delayx1ms? Delay

It indicates that the delayx1ms () function is not called by other functions and occupies the program memory space.
Solution: remove the delayx1ms () function or use Conditional compilation # If ..... # Endif, which can be retained and does not compile

6 *** warning 6: xdata space memory overlap
From: 0025 H
To: 0025 H

Description: The address of the external data Rom is already defined at 0025 H.
Solution: the external data Rom is defined as pdata unsigned char xfr_adc _ at_0x25. The xfr_adc variable name is 0x25, check whether other variable names are defined at 0x25 and corrected.

7 warning 206: 'delayx1ms ': missing function-Prototype
C:/8051/input. c
Error 267: 'delayx1ms ': requires ANSI-style prototype C:/8051/input. c

The delayx1ms function is called in the program. If this function is not defined, no program content is written or the function is defined, but no declaration is made.
Solution: After writing delayx1ms content, you must make a declaration or make an external declaration. You can declare the content file in delay. h as an external one so that other functions can be called.

8 *** warning 1: unresolved external symbol
Symbol: music3
Module: C:/8051/music. OBJ (music)
* ** Warning 2: reference made to unresolved external
Symbol: music3
Module: C:/8051/music. OBJ (music)
Address: 0018 H

The program calls the music function but does not add the expanded C of the function to the project prj for compilation and connection.
Solution: Set the music3 function to add music C to the project file in Music C.

9 *** error 107: addess space Overflow
Space: Data
Segment: _ data_goup _
Length: 0018 H
* ** Error 118: reference made to erroneous external
Symbol: volume
Module: C:/8051/osdm. OBJ (osdm)
Address: 4036 H

The address range of the data bucket is 0 ~ 0x7f: when the number of public variables and the local variables in the function are set to small in the storage mode, the local variables first use the working register R2 ~ R7 for temporary storage when the storage space is insufficient, the address will be insufficient when the number of temporary storage space in the Data Type exceeds 0x7f.
Solution: Change the public variables defined by data type to idata Type Definitions.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.