Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: Handling 'i...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 15 of 17 Topic 26103 of 26960
Post > Topic >>

Re: Handling 'initializer element not constant' error

by Flash Gordon <spam@[EMAIL PROTECTED] > May 8, 2008 at 06:56 AM

Richard Tobin wrote, On 07/05/08 23:29:
> In article
<290288be-6c58-49e1-9bef-ec4e3e5de7ca@[EMAIL PROTECTED]
>,
>  <vippstar@[EMAIL PROTECTED]
> wrote:
> 
>> I have not read much on alternative solutions to errno in C, so is
>> there a better solution?
>> Returning the error code is not possible (like pthreads) and an extra
>> parameter to every function that can fail would be quite annoying.
> 
> The C standard recognises the problems with errno and doesn't require
> it to be an identifier.  It just has to be a macro that produces a
> modifiable lvalue.  So a threaded implementation can do something
> like
> 
>    #define errno (*__thread_errno())
> 
> where __thread_errno() returns a pointer to a per-thread variable.

One real example of this is current versions of glibc where after a bit 
of digging I get
#   define errno (* __errno_location ())
-- 
Flash Gordon
 




 17 Posts in Topic:
Handling 'initializer element not constant' error
Gowtham <gowthamgowtha  2008-05-07 07:14:35 
Re: Handling 'initializer element not constant' error
viza <tom.viza@[EMAIL   2008-05-07 07:43:00 
Re: Handling 'initializer element not constant' error
Willem <willem@[EMAIL   2008-05-07 15:20:02 
Re: Handling 'initializer element not constant' error
richard@[EMAIL PROTECTED]  2008-05-07 17:01:29 
Re: Handling 'initializer element not constant' error
vippstar@[EMAIL PROTECTED  2008-05-07 10:29:14 
Re: Handling 'initializer element not constant' error
richard@[EMAIL PROTECTED]  2008-05-07 19:21:06 
Re: Handling 'initializer element not constant' error
Keith Thompson <kst-u@  2008-05-07 13:38:56 
Re: Handling 'initializer element not constant' error
vippstar@[EMAIL PROTECTED  2008-05-07 10:31:30 
Re: Handling 'initializer element not constant' error
vippstar@[EMAIL PROTECTED  2008-05-07 13:49:08 
Re: Handling 'initializer element not constant' error
richard@[EMAIL PROTECTED]  2008-05-07 22:29:06 
Re: Handling 'initializer element not constant' error
Ben Pfaff <blp@[EMAIL   2008-05-07 15:30:43 
Re: Handling 'initializer element not constant' error
richard@[EMAIL PROTECTED]  2008-05-07 22:40:52 
Re: Handling 'initializer element not constant' error
Ben Pfaff <blp@[EMAIL   2008-05-07 15:46:39 
Re: Handling 'initializer element not constant' error
dj3vande@[EMAIL PROTECTED  2008-05-07 22:44:24 
Re: Handling 'initializer element not constant' error
Flash Gordon <spam@[EM  2008-05-08 06:56:18 
Re: Handling 'initializer element not constant' error
Peter Nilsson <airia@[  2008-05-07 15:20:10 
Re: Handling 'initializer element not constant' error
Szabolcs Borsanyi <bor  2008-05-09 02:32:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 16:36:30 CDT 2008.