comp.lang.c
  Home FAQ Contact Sign in
comp.lang.c only
 
Advanced search
December 2007
motuwethfrsasuw
     12 48
3456789 49
10111213141516 50
17181920212223 51
24252627282930 52
31       1
2007
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Re: replacement for 'pow()' function         


Author: Richard Bos
Date: Dec 16, 2007 23:09

"Boudewijn Dijkstra" indes.com> wrote:
> Op Thu, 13 Dec 2007 14:37:43 +0100 schreef Chris Dollin
>> pete wrote:
>>> Thad Smith wrote:
>>
>>>> Interesting. What are the license requirements on the code?
>>>
>>> It's just trivial code.
>>
>> Licensing isn't about whether the code is trivial or not.
>
> Yes it is. Any license on something trivial cannot be enforced. Except
> in an unreasonable justice system, of course...

pete is in the USA.

Richard
no comments
  Re: Avoiding dereference of NULL pointer         


Author: Chris Thomasson
Date: Dec 16, 2007 14:55

"Tor Rustad" hotmail.com> wrote in message
news:yI2dnayMw5DtH_na4p2dnAA@telenor.com...
> Tony Jackson wrote:
>> Hi
[...]
>> like to do is be able to ignore the dereference attempt and just carry
>> on - probably the next time round the loop the pointer will be OK. In
>> Java, I'd put a try block around the main loop, and if we catch an
>> exception then just jump back to the start of the main loop. What's the
>> corresponding thing in C?
>
> The corresponding thing in C, would be to save environment via setjmp,
> install a signal handler for SIGSEGV and do a longjmp when such a signal
> occurs.

longjmp isn't in the list of async-signal-safe functions:

http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html

So you cannot call it from within a signal-handler. Use sigsetjmp/siglongjmp
instead. Also, be careful to not call siglongjmp from a nested
signal-handler as it results in undefined behavior:
Show full article (1.01Kb)
no comments
  Re: C Variables Length         


Author: Francine.Neary
Date: Dec 16, 2007 14:28

On Dec 14, 11:14 pm, Eric Sosman wrote:
> Ben Pfaff wrote:
>> lak writes:
>
>>> I want to know what is the variable length in c.
>>> I K&R they stated that atleast 31 character.
>>> But I give 1 lakhs length to a variable, but my compiler doesn't say
>>> any error.
>
>> The number of significant characters in an identifier varies
>> among implementations. It is at least 31 for internal
>> identifiers and 6 for external identifiers in C90, and higher
>> than that in each case for C99.
>
>> I don't know what a "lakh" is.
>
> 1E5, or GIYF.
Show full article (0.84Kb)
no comments
  Large Files         


Author: raj
Date: Dec 16, 2007 14:24

Hi friends,

In an interview I was asked to write a C program to create a large file
of 8GB

The first 4GB is filled with "Hello"

and the secod 4GB is filled with "World"

Sorry to say that I don't know how to do that in an elegant way. I think
it is a trick question depending on if size_t is 32 bits or 64 bits.

Does anybody know how?

Thanks for answering!
10 Comments