Bug 000333

When Created: 12/16/2000 15:16:00
Against DJGPP version: 2.01
By whom:
Abstract: DJGPP resfuse multiplication

I got a program which is supposed to fill SRC with 5 "ABCDEFGHIJ" in a row. Then the program is gonna pick 1 letter from SRC every ten letters and put
it in DEST, thus DEST would be filled with "AAAAA".
Unfortunately, although it's working under Turbo C++, DJGPP refuse to compile
apparently because of a multiplication at the line: "src[i*10]";

Here's my source code:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

void main()
int i;
char *src = (char *)malloc(100);
char *dest = (char *)malloc(20);


for (i=0; i<5; i++) dest[i] = src[i*10]; /* ERROR */


printf("\r\nSrc says: %s \r\nDest says: %s\n", src, dest);


Note added: 12/20/2000 07:59:24
By whom:
This is not reproducible.  I'm sure it's some kind of cockpit error.

I'm clisong this report.

Closed on 12/20/2000 08:00:22: Not reproducible
By whom:

Note added: 12/24/2000 08:50:22
By whom:
First, i'm french so excuse my english.
I think i found the solution:
DJGPP refuses to multiply a variable with by number.

DJGPP refuses to compile this:

int a,b;

but it accepts:

int a,b,c;

Maybe a didn't check an option which allows me to do that.
I don't know.

Franck Bauquier

Note added: 12/31/2000 02:46:16
By whom:
I still cannot reproduce this.

  webmaster     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010