dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Pnet-developers] Using cscc to comple C


From: Rob Farnum
Subject: RE: [Pnet-developers] Using cscc to comple C
Date: Thu, 26 Aug 2004 12:23:06 -0700

 
With respect to win32 vs. linux, would you expect to see any compilation
differences?

I did a configure w/ defaults for windows XP w/ cygwin, w/ pnetC-0.6.8

I have a simple C example that shows a variety of problems.

#1  define LONG_ERROR or CPOINTER_ERROR
    this gives you a compile error w/ unresolved type.
    Is long not defined?  Char *???

#2  define PRINTF_ERROR
    segfaults at runtime.  Sometimes w/ VerificationException, depending on
complexity
    of the code.

Does this sample code 'work' for others, or is there something wrong with my
setup?


#include <stdio.h>
#include <malloc.h>

//#define CPOINTER_ERROR
//#define LONG_ERROR
#define PRINTF_ERROR

typedef struct 
{
   int me;
#ifdef CPOINTER_ERROR
   char  *foobar;
#endif
#ifdef LONG_ERROR
   long     bar;
#endif
} foo;

void test(char *s)
{
#ifdef PRINTF_ERROR
  printf("%s\n", s);
#endif
}

int main(int argc, char *argv[])
{
  int n;

  n = sizeof(foo);

  test("prompt");

  return 0;
}


-----Original Message-----
From: Gopal V [mailto:address@hidden 
Sent: Thursday, August 26, 2004 11:06 AM
To: John Goerzen; address@hidden
Subject: Re: [Pnet-developers] Using cscc to comple C

Hi,

> In my opinion, one of the most interesting features of cscc is the  
> ability to compile C source code.

It's not just a "feature" :) ... It was a great way to

show off the platform-frontend seperation of cscc :)

>  I realize this  may never be possible, but there are other 
> interesting possibilities too.

Array boundchecked arrays , checks for memory overwrites, leaks  .. Anything
you can do with an OpenSource VM :)

> able to compile and run a small Hello, World application.  (Note: if I 
> use printf() with only a format string and no additional args, the 
> resulting application cannot run with Mono but still runs with pnet.)

I'll have a good look at cscc-c-s after the weekend (if you want anything to
be fixed in particular).

> tested were: sed
> wget bash gzip bzip2 coreutils textutils dash.  I did discover one

I did try to build gzip something back ... there is a bug in the dereference
code generation in cscc which I haven't bothered fixing yet .. it fails
verification, even if you get it to compile.

> Here's my question: are you interested in fixing these issues?

Time is my biggest issue ... I work on pnet strictly on weekends . What
would be nice would be for you to track down bugs with as much details as
possible and report them , I'll be able to fix them (hopefully) on the next
weekend. And you could also get a nicer view of how stuff in pnetC and cscc
works (like pthreads which is very very nicely done up) during this so that
you can slowly move into the actual development.

I started on  pnet by reporting bugs and ended up doing up stuff :)

Gopal


                
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
_______________________________________________
Pnet-developers mailing list
address@hidden
http://dotgnu.org/mailman/listinfo/pnet-developers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]