v7.0的setjmp.h文件比6.23的做了改动.v7.0的setjmp.h文件有语法错误.
v7.0的setjmp.h内容如下:
/*--------------------------------------------------------------------------
SETJMP.H
Prototypes for longjmp facility.
Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
--------------------------------------------------------------------------*/
/* define the buffer type for holding the state information */
#ifdef __CX51__
#ifndef _JMP_BUF_DEFINED
#define _JBLEN 9 /* SP, SPE, ?C_XBP, ?C_IBP, ?C_PBP, RET-ADDR */
#else
#ifndef _JMP_BUF_DEFINED
#define _JBLEN 7 /* RET-ADDR, ?C_XBP, ?C_IBP, ?C_PBP, SP */
#endif
typedef char jmp_buf[_JBLEN];
#define _JMP_BUF_DEFINED
/* function prototypes */
int setjmp (jmp_buf);
void longjmp (jmp_buf, int);
===========================================
而V6.23的setjmp.h内容如下:
/*--------------------------------------------------------------------------
SETJMP.H
Prototypes for longjmp facility.
Copyright (c) 1988-2001 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
--------------------------------------------------------------------------*/
/* define the buffer type for holding the state information */
#pragma SAVE
#pragma REGPARMS
#ifndef _JMP_BUF_DEFINED
#define _JBLEN 7 /* RET-ADDR, ?C_XBP, ?C_IBP, ?C_BP, SP */
typedef char jmp_buf[_JBLEN];
#define _JMP_BUF_DEFINED
#endif
/* function prototypes */
int setjmp (jmp_buf);
void longjmp (jmp_buf, int);
#pragma RESTORE
===================================
这两个文件不同,当包含该文件时,也就是#include
时会导致编译错误.
这应该是软件的一个新的bug.建议不要使用setjmp.h或者对setjmp.h使用旧版本的文件.