Optimiser question3233 (12/13/2007 2:41:46 PM) comp.lang.c Hi All, I have been given some code to wok on. It relies heavily on the optimiser to run at the correct speed. With this in mind I have been loking through it to see if I can help it out a bit. I have limitied ... david.sanderson(6)
volatile + threads1225 (12/15/2007 2:04:15 PM) comp.lang.c The following tries to make thread-safe code while avoiding the high cost of a lock. But is it kosher? // file or global scope level int X; volatile _Bool IsInitializedX=false; // thread 1 X=5; IsInitial... nospam59(9806)
pointers to functions question1928 (1/3/2008 2:22:12 AM) comp.lang.c #include #include void func(int); main(){ void (*fp)(int); fp = func; // here when assigning a pointer, why not fp=&func; ? (*fp)(1); fp(2); exit(EXIT_SUCCESS); } void func... Logan.W.Lee1(38)
cast pointer to int1825 (1/4/2008 5:16:43 AM) comp.lang.c Hi All, I was going through one tutorial about C language's pointer. After reading the tutorial I got couple of questions regarding cast of pointer to integer . In the exercise there is one question as ment... somenathpal(141)
Howto "goto address_x;"1526 (1/4/2008 8:49:15 AM) comp.lang.c Before I start, please let's not discuss whether goto is evil or not. For generated code, this can make perfect sense. It would be interesting to know a trick how to get C to do a goto to an address that has ... fschaef(4)
Recovering from out of memory on the stack6222 (1/10/2008 6:31:57 PM) comp.lang.c Hi, I know that it's good practise to check the returned pointer from malloc() against NULL when making large allocations on the heap, so as to be able to attempt recovery in case of an out-of-memory error. B... sandysimons53(3)
Implementation -defined behavior1729 (5/6/2009 10:02:48 PM) comp.lang.c will the following code have implementation defined behavior??? int main() { int *i,j; i=(int*)10; return 0; } is it certain as to what value is stored in i??? ... amit.codename13(35)
improve my substring function?221 (5/8/2009 7:03:05 PM) comp.lang.c Namely I'd like to silence this compiler warning: util.c: In function 'substring': util.c:50: warning: value computed is not used util.c:51: warning: value computed is not used But I'm open to all suggestions... joesiege(18)
Non constant initializer1026 (5/9/2009 3:52:13 AM) comp.lang.c Consider the following code...... #include #include int fact() { int i , j=1; if( scanf ( "%d" , &i )) { while( i ) { if ( j = j * i-- ) { } } if( printf ( "%d" , j )) { {} } } exit(0); return 0; } int x=fact... prasoonthegreat(66)
Macro to determine if a struct is a power of 2931 (5/14/2009 10:39:48 PM) comp.lang.c Hi, An API requires that buffers be powers of 2, so I borrowed a macro from Sean Anderson bit hacks page for the following macro: #define IS_NOT_POWER_OF_2(v) (((v) & ((v) - 1)) && (v)) I then test the con... brett.moore(2)