Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
February 01, 2004 Illegal instruction running very simple program | ||||
---|---|---|---|---|
| ||||
Attachments: | Running the following program gave an illegal instruction error from windows (attached is the windows dialog showing the error). Any clues? Thanks in advance. ----- Error from windows: The NTVDM has encountered an illegal instruction. CS:0dce IP001d OP:ff ff ae ff ff Choose 'Close' to terminate the application ----- module java.util.test.TestArrayList; int main (char[][] args) { printf("hello world\n"); printf("args.length = %d\n", args.length); for (int i = 0; i < args.length; i++) printf("args[%d] = '%s'\n", i, (char *)args[i]); return 0; } |
February 01, 2004 Re: Illegal instruction running very simple program | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andres Rodriguez | Sorry, my mistake, I was invoking the compiler with a '-c' and '-of' Should thi be an error? Should the compiler issue a warning? Or is there a case where you might want to do this? "Andres Rodriguez" <rodriguez@ai.sri.com> wrote in message news:bvjg9a$dck$1@digitaldaemon.com... > Running the following program gave an illegal instruction error from windows (attached is the windows dialog showing the error). Any clues? Thanks in advance. > > ----- > > Error from windows: > > The NTVDM has encountered an illegal instruction. > CS:0dce IP001d OP:ff ff ae ff ff Choose 'Close' to terminate the application > > ----- > > module java.util.test.TestArrayList; > > int main (char[][] args) { > printf("hello world\n"); > printf("args.length = %d\n", args.length); > for (int i = 0; i < args.length; i++) > printf("args[%d] = '%s'\n", i, (char *)args[i]); > return 0; > } > > > |
February 01, 2004 Re: Illegal instruction running very simple program | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andres Rodriguez | Hi Andrés, your program has a little mistake. In D you can not use %s directly because the strings are not null ended. Use %.*s instead of %s and it must work. I think you need to read the documentation a bit more ;-). Regards. P.S.: ¿Otro español? "Andres Rodriguez" <rodriguez@ai.sri.com> escribió en el mensaje news:bvjgkd$e0c$1@digitaldaemon.com... > Sorry, my mistake, I was invoking the compiler with a '-c' and '-of' Should thi be an error? Should the compiler issue a warning? Or is there a case where you might want to do this? > > > "Andres Rodriguez" <rodriguez@ai.sri.com> wrote in message news:bvjg9a$dck$1@digitaldaemon.com... > > Running the following program gave an illegal instruction error from windows (attached is the windows dialog showing the error). Any clues? Thanks in advance. > > > > ----- > > > > Error from windows: > > > > The NTVDM has encountered an illegal instruction. > > CS:0dce IP001d OP:ff ff ae ff ff Choose 'Close' to terminate the > application > > > > ----- > > > > module java.util.test.TestArrayList; > > > > int main (char[][] args) { > > printf("hello world\n"); > > printf("args.length = %d\n", args.length); > > for (int i = 0; i < args.length; i++) > > printf("args[%d] = '%s'\n", i, (char *)args[i]); > > return 0; > > } > > > > > > > > |
February 01, 2004 Re: Illegal instruction running very simple program | ||||
---|---|---|---|---|
| ||||
Posted in reply to Samuel | My apologies, I've try the program and it works (I think I need to read more the documentation ;-) Samuel |
February 01, 2004 Re: Illegal instruction running very simple program | ||||
---|---|---|---|---|
| ||||
Posted in reply to Samuel | Samuel wrote:
>>
>> P.S.: ¿Otro español?
>>
No español, pero sí ecuatoriano.
-----------------------
Carlos Santander Bernal
|
February 01, 2004 Re: Illegal instruction running very simple program | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andres Rodriguez | Andres Rodriguez wrote:
>> Sorry, my mistake, I was invoking the compiler with a '-c' and '-of' Should thi be an error? Should the compiler issue a warning? Or is there a case where you might want to do this?
>>
>>
Yes, that's the problem. Drop the "-c".
-----------------------
Carlos Santander Bernal
|
February 01, 2004 Re: Illegal instruction running very simple program | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | > Samuel wrote:
> >>
> >> P.S.: ¿Otro español?
> >>
>
> No español, pero sí ecuatoriano.
>
> -----------------------
> Carlos Santander Bernal
>
>
Encantado, parece que hay unos cuantos hispanohablantes en este foro.
Samuel Martín Valentín
|
Copyright © 1999-2021 by the D Language Foundation