Re: No code in procedure user_main

From: Dan Bonachea (bonachea_at_cs_dot_berkeley_dot_edu)
Date: Thu Jun 23 2005 - 11:42:27 PDT

  • Next message: Dan Bonachea: "Re: Error translating "hello UPC world""
    At 03:23 AM 6/23/2005, Nico Kasprzyk wrote:
    >Hello list,
    >
    >I want to use UPC as a C to C compiler and also play with some more options 
    >that are offered by upcc script. Thus, I want to process my source code with 
    >following commands:
    >
    > > gfec -O0 -ansi -dx -version -quiet -dumpbase test.c \
    >     test.E.c -o test.F.c
    > > be  -PHASE:i:l -fB,test.F.c test.c
    > > whirl2c -fB,test.N test.c
    
    We only support compilation using the upcc script, which performs some 
    additional transformations on the generated code. You might try the upcc -Wu, 
    and upcc -Ww, options to pass the flags you're interested in to the translator 
    (and possibly -trans if you only want the translation step), however we don't 
    document support for any -Wu/-Ww options at this time, so if things break 
    there you're also on your own.
    
    Hope this helps..
    Dan
    
    
    >In test.c I have included following code:
    >
    >int one_function() {
    >   return 45;
    >}
    >
    >int user_main() {
    >   int a[50];
    >   int b[50];
    >   int i;
    >   a[8]=1;
    >   a[9]=25;
    >   for( i=10;i<one_function();i++ ) {
    >     a[i] = a[i-1] + a[i-2];
    >     b[i] = a[i-1];
    >   }
    >
    >   return a[30];
    >}
    >
    >The program gfec gets the preprocessed file test.E.c. If I call whirl2c with 
    >test.F.c a nearly original C file is created. But whirl2c called with test.N 
    >creates an file with following content:
    >
    >/*******************************************************
    >  * C file translated from WHIRL Thu Jun 23 10:41:17 2005
    >  *******************************************************/
    >
    >/* Include file-level type and variable decls */
    >#include "test.w2c.h"
    >
    >
    >extern _INT32 user_main()
    >{
    >
    >
    >   return 0;
    >} /* user_main */
    >
    >
    >My simple question is: What is wrong?
    >
    >I hope you can help me.
    >
    >Regards,
    >
    >Nico Kasprzyk
    

  • Next message: Dan Bonachea: "Re: Error translating "hello UPC world""