harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Hamid <ar...@cornell.edu>
Subject Re: compiling JCHEVM with MSVC
Date Mon, 21 Nov 2005 17:13:21 GMT
My understanding is that the original, C99 syntax*, allows one to populate "sparse" arrays,
based on constants or enums.  This means as the constants or enums change value during development,
you are not left with arrays that have been defined with values at implicit offsets (which
is what priming the array with an initial bogus value of "" is doing), resulting in things
starting to come down in flames because of access to incorrect array indices.

Aaron

[*] copied from Archie's post: http://docs.sun.com/source/819-0494/c99.app.html#pgfId-1004206

Enrico Migliore wrote:
> 
>>>
>>>
>>> I have to manually create the config.h file, and compile the code 
>>> step by step.
>>> At the moment, I got the following error from the MSVC compiler:
>>>
>>> D:\projects\harmony-jcvm\jcvm\libjc\jc_invoke.c(81) : error C2059: 
>>> syntax error : '['
>>>
>>> which refers to the following declaration:
>>>
>>> /* Map command line option to VM args property */
>>> static const    char *const jc_opt2prop[] = {
>>>    [OPT_CLASSPATH]=    JAVA_CLASS_PATH,
>>>    [OPT_LIBRARYPATH]=    JAVA_LIBRARY_PATH,
>>>    [OPT_BOOTCLASSPATH]=    JAVA_BOOT_CLASS_PATH
>>> };
>>>
>>> Got any suggestion in order for me to proceed?
>>
>>
>>
>> try:
>> +++
>> static const    char *const jc_opt2prop[] = {
>>        "",
>>        JAVA_CLASS_PATH,
>>        JAVA_LIBRARY_PATH,
>>        JAVA_BOOT_CLASS_PATH
>> };
>> +++
>> But that is a very bad work-around!
>>
> Hi Jean-frederic,
> 
> the work-around you suggested me, works!
> 
> Could you please tell me why you consider it "bad"?
> 
> ciao,
> Enrico

Mime
View raw message