Today, after I changed one of my programs into multiple files, the following alarm appeared: not in formal parameter list.
I searched for a long time but couldn't solve the problem. Later, I found someone else's solution to the same problem on the Internet. It was caused by a missing semicolon in a function declaration in the header file. I immediately checked my own program and found that a semicolon was missing as well. After adding the semicolon, the compilation and linking passed.
The following is the article I reprinted that solved the problem:
error C132: "****" not in formal parameter list
It took me nearly half an hour to find the error, and finally found that it was because a semicolon was missing in a function declaration in the header file, causing the parameter declared immediately below it not in the formal parameter list. I wrote it down here so that I don't forget it later, and it is also for everyone to share. The error code is as follows:
I listed the function declarations in the function declaration as follows:
void Display_Normal();
void Display_Reset()
void Display_Year() ; void Display_Month()
;
void Display_Day();
void Display_Week();
void Display_Hour();
void Display_Minute();
void Display_Second();
Here are some other common error prompts:
1. The first error message
***WARNING L15: MULTIPLE CALL TO SEGMENT
SEGMENT: ?PR?_WRITE_GMVLX1_REG?D_GMVLX1 CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP
***WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?_SPI_SEND_WORD?D_SPI CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP ***WARNING L15: MULTIPLE
CALL TO SEGMENT SEGMENT: ?PR?SPI_RECEIVE_WORD?D_SPI CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP
This warning indicates that the linker has found a function that may be called simultaneously by the main function and an interrupt service routine (or a function that calls an interrupt service routine), or by multiple interrupt service routines at the same time.
One of the reasons for this problem is that this function is a non-reentrant function. When the function is running, it may be interrupted by an interrupt, which may change the result and may cause some variable conflicts (that is, cause some data in the function to be lost. Reentrant functions can be interrupted by ISR at any time and can run again after a period of time, but the corresponding data will not be lost). The second reason is that the memory area used for local variables and variables (for the time being, arguments, [independent variables, variables-values, used to determine the value of a program or subroutine]) is overwritten by the memory area of other functions. If the function is interrupted, its memory area will be used, which will cause memory conflicts in other functions. For example, the first warning indicates that the function WRITE_GMVLX1_REG is defined in D_GMVLX1.C or D_GMVLX1.A51 and is called by an interrupt service routine or a function that calls an interrupt service routine, the function that calls it is VSYNC_INTERRUPT in MAIN.C. Solution: If you are sure that the two functions will never be executed at the same time (the function is called by the main program and interrupts are disabled), and the function does not occupy memory (assuming that only registers are used), then you can completely ignore this warning. If the function occupies memory, you should use the linker OVERLAY directive to exclude the function from overlay analysis, for example: OVERLAY (?PR?_WRITE_GMVLX1_REG?D_GMVLX1 ! *) The
above directive prevents the memory area used by the function from being overwritten by other functions. If the function calls other functions, and these functions are also called elsewhere in the program, you may want to exclude these functions from overlay analysis as well. This OVERLAY directive enables the compiler to remove the above warning message. If the function can be called during its execution, the situation becomes more complicated.
In this case, the following methods can be used:
A. Disable interrupts when the main program calls the function. You can use the #pragma disable statement to achieve the purpose of disabling interrupts when the function is called. The OVERLAY directive must be used to remove the function from the coverage analysis.
B. Copy the code of the function twice, one to the main program and the other to the interrupt service routine.
C. Set the function to be reentrant. For example: void myfunc(void) reentrant { ... } This setting will generate a reentrant stack, which is used to store function values and local variables. When using this method, the reentrant stack must be configured in the STARTUP.A51 file. This method consumes more RAM and slows down the execution of reentrant functions.
2. The second error message *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_COMPARE?TESTLCD Explanation: Some functions (or segments) in the program have never been called before (during debugging), or there is no statement to call it at all. There should be a message before this warning message indicating which function caused the problem. Just make some simple adjustments. It is no big deal to ignore it. Solution: Remove the COMPARE() function or use conditional compilation #if …..#endif to keep the function and not compile.
3. Warning 280: 'i': unreferenced local variable
Description The local variable i is not accessed in any way in the function
Solution Eliminate the declaration of the variable i in the function
4 Warning 206: 'Music3': missing function-prototype
Description The Music3() function has not been declared or has not been declared externally, so it cannot be called by other functions.
Solution Write the statement void Music3(void) at the beginning of the program to declare it. If it is a function of other files
, write it as extern void Music3(void), that is, declare it externally.
5 Compling: C:\8051\MANN.C
Error: 318: can't open file 'beep.h'
Description During the compilation of C:\8051\MANN.C program, main.c used the instruction #include "beep.h",
but it could not be found.
Solution Write an include file of beep.h and save it in the working directory of c:\8051
6 Compling:C:\8051\LED.C
Error 237:'LedOn':function already has a body
Explanation The LedOn() function name is defined repeatedly, that is, there are more than two identical function names.
Solution: Correct one of the function names so that all function names are independent.
7 ***WARNING 16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
SEGMENT: ?PR?_DELAYX1MS?DELAY
Description The DelayX1ms() function will occupy program memory even if it is not called by other functions.
Solution Remove the DelayX1ms() function or use conditional compilation #if …#endif to keep the function and not
compile it.
8 ***WARNING 6 :XDATA SPACE MEMORY OVERLAP
FROM : 0025H
TO: 0025H
Explanation The 0025H address of the external data ROM is defined repeatedly.
Solution: The definition of the external data ROM is as follows:
Pdata unsigned char XFR_ADC _at_0x25 The name of the XFR_ADC variable is 0x25. Please check if there are other variable names defined at 0x25 and correct them.
9 WARNING 206:'DelayX1ms': missing function-prototype
C:\8051\INPUT.C
Error 267 :'DelayX1ms ':requires ANSI-style prototype C:\8051\INPUT.C
Explanation The DelayX1ms function is called in the program but the function is not defined, that is, the program content is not written or the function
is defined but not declared.
Solution: After writing the content of DelayX1ms, it must be declared or declared externally. It can
be declared as external in the include file of delay.h to facilitate other functions to call it.
10 ***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:0018H
Description The program calls the MUSIC function but does not add the extension file C of the function to the project file
Prj for compilation and linking.
Solution: Set the MUSIC3 function in MUSIC C and add MUSIC C to the project file.
11 ***ERROR 107: ADDESS SPACE OVERFLOW
SPACE: DATA
SEGMENT: _DATA_GOUP_
LENGTH: 0018H
***ERROR 118: REFERENCE MADE TO ERRONEOUS EXTERNAL
SYMBOL: VOLUME
MODULE: C:\8051\OSDM.OBJ (OSDM)
ADDRESS: 4036H
Explanation The address range of the data storage space is 0~0x7f. When the number of public variables and local variables in a
function is set to SMALL, the local variables will first use the working registers R2~R7 for temporary storage. When the memory is insufficient
, the data type space will be used for temporary storage. When the number exceeds 0x7f, the address will be insufficient.
Solution: Change the public variables defined as data type to idata type.
Previous article:Storing information in the watchdog in the microcontroller
Next article:WARNING 15 (MULTIPLE CALL TO SEGMENT)
Recommended ReadingLatest update time:2024-11-23 08:09
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Hiring embedded software engineer
- TMS320VC5509A DSP Learning Route
- SPI device driver learning BUG problem record
- Linux Application Development Manual Based on ARM AM335x
- 3G Mobile Phone PA Module Power Management Challenges
- C6748 Data width problem
- What are the key points of using Tool-Graphs in CCS5 Debug mode?
- Construction of TI cc2541 protocol stack development environment
- [TI recommended course] #ESD electrostatic protection introduction series video#
- Power supply - What is the principle of BUCK feedback?