This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What happens in this var declaration mistake?

Here's an excerpt of my main module (the beginning of it):

#include <ezusb.h>
#include <ezregs.h>
#include <tng.h>
#include <string.h>
#include "system.h"
#include "lcd.h"

#define IMG_SIZE (21*16)

extern BYTE xdata DataBuf[];
volatile BYTE Display_Mode, LineCount, X_Offset, Row_Start = 0,
GrabRequest, GrabOn, H_Bytes, Zoom_Value;
DWORD j;
BYTE i;
WORD ill1=1500, ill2=1500;
static xdata WORD k = 300;

void ShowPicture(void)
{
... ordinary functions and code

I accidentally put a semicolon after "Row_Start = 0" when splitting the line for new variables. The module compiled fine, resulting to weird behavior.

So, what exactly does the compiler do when encountering plain variable names on a line? I'm using KEIL V5.20 (DLL 1.32a).
Thanks,
Harri

0