Changeset 9e2c1f0 for src/examples
- Timestamp:
- May 6, 2016, 4:28:50 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- ec79847
- Parents:
- 99ee64d (diff), 03e5d14 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/examples
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/abstype.c
r99ee64d r9e2c1f0 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 27 18:10:01 201513 // Update Count : 412 // Last Modified On : Wed Apr 6 22:16:08 2016 13 // Update Count : 8 14 14 // 15 15 16 type T | { T x( T ); };16 otype T | { T x( T ); }; 17 17 18 18 T y( T t ) { … … 21 21 } 22 22 23 forall( type T) lvalue T*?( T* );24 int ?++( int * );25 int ?=?( int *, int );26 forall( dtype DT) DT* ?=?( DT **, DT* );23 forall( otype T ) lvalue T *?( T* ); 24 int ?++( int * ); 25 int ?=?( int *, int ); 26 forall( dtype DT ) DT * ?=?( DT **, DT* ); 27 27 28 type U = int*;28 otype U = int *; 29 29 30 30 U x( U u ) { -
src/examples/alloc.c
r99ee64d r9e2c1f0 11 11 // Created On : Wed Feb 3 07:56:22 2016 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Feb 17 11:43:23201614 // Update Count : 4013 // Last Modified On : Fri Mar 11 17:42:08 2016 14 // Update Count : 59 15 15 // 16 16 17 forall( otype T ) T * malloc( char fill ); 18 forall( dtype T ) T *?=?( T **, void * ); 19 void *malloc( unsigned long int ); 20 #if 0 17 21 #include <fstream> 18 22 #include <stdlib> … … 25 29 int * bar( int * p, int c ) { return p; } 26 30 int * baz( int * p, int c ) { return p; } 31 #endif 27 32 28 33 int main( void ) { 34 #if 0 29 35 size_t size = 10; 30 36 int * p; 31 37 struct S { int x; double y; } * s; 38 #endif 32 39 40 #if 0 33 41 p = malloc( sizeof(*p) ); // C malloc, type unsafe 34 42 printf( "here1\n" ); … … 37 45 printf( "here2\n" ); 38 46 free( p ); 39 p = malloc( (char)'\0' ); // CFA malloc, type safe 47 #endif 48 // int * p; 49 // p = malloc( (char)'\0' ); // CFA malloc, type safe 50 (int *)malloc( (char)'\0' ); // CFA malloc, type safe 51 (void *)malloc( (char)'\0' ); // CFA malloc, type safe 52 #if 0 40 53 printf( "here3\n" ); 41 54 p = malloc( p, 1000 ); // CFA remalloc, type safe … … 60 73 printf( "here9\n" ); 61 74 free( p ); 62 #if 0 75 63 76 float * fp = malloc() + 1; 64 77 fprintf( stderr, "%p %p\n", fp, fp - 1 ); -
src/examples/includes.c
r99ee64d r9e2c1f0 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 23:28:02 201613 // Update Count : 3 2812 // Last Modified On : Wed Apr 13 22:30:02 2016 13 // Update Count : 370 14 14 // 15 15 … … 24 24 #if 1 25 25 #define _GNU_SOURCE 26 #include <aio.h>27 #include <a.out.h>28 #include <aliases.h>29 #include <alloca.h>30 #include <ansidecl.h>31 #include <ar.h>32 #include <argp.h>26 //#include <aio.h> 27 //#include <a.out.h> 28 //#include <aliases.h> 29 //#include <alloca.h> 30 //#include <ansidecl.h> 31 //#include <ar.h> 32 //#include <argp.h> 33 33 #include <argz.h> 34 #include <assert.h>34 //#include <assert.h> 35 35 #include <bfd.h> 36 #if 0 36 37 #include <bfdlink.h> 37 38 #include <byteswap.h> … … 56 57 #include <err.h> 57 58 #include <errno.h> 58 #if 059 59 #include <error.h> 60 #endif61 60 #include <eti.h> 62 61 #include <evdns.h> 63 62 #include <event.h> 64 63 #include <evhttp.h> 64 #endif 65 65 #if 0 66 66 #include <evrpc.h> … … 129 129 130 130 //#define _GNU_SOURCE 131 #include <error.h> 131 #include <bfd.h> 132 //#include <error.h> 132 133 133 134 #endif // 0
Note: See TracChangeset
for help on using the changeset viewer.