访问手机版页面
你的位置:老古开发网 > 51单片机 > 51单片机Keil C51编程 > 正文  
keil 7.0编译出现:error C316: unterminated conditionals
内容导读:
很多程序用keil c51 v6.xx可以编译通过,但用v7.0出现C316的错误.原因在于v7.0的setjmp.h头文件出错.

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使用旧版本的文件.

标签:
来源: 作者: 时间:2002/5/14 0:00:00
相关阅读
推荐阅读
阅读排行
最近更新
商品推荐