Re: Header files with enums instead of defines?

From: M. Warner Losh (imp_at_bsdimp.com)
Date: 12/22/04

  • Next message: Scott Long: "Re: Header files with enums instead of defines?"
    Date: Wed, 22 Dec 2004 11:34:11 -0700 (MST)
    To: peadar.edwards@gmail.com
    
    

    In order to gain the benefits of the enums, errno would need to be an
    enum errno_t or some such. This breaks C++ code that sets errno = 0,
    since you can't assign integers to errno values.

    So even if you retained EBOGUS or whatever, this wouldn't work with
    C++. errno has to be an int to work there.

    Warner
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: Scott Long: "Re: Header files with enums instead of defines?"

    Relevant Pages

    • Re: Use enum to declare errno values
      ... >>> Unlike in other languages, C enum is not much useful in practices. ... I like to use a lot of both enums and macros. ... Although it can be argued that errno should be enums, ... I seldom use enums for kernel programming though. ...
      (Linux-Kernel)
    • Re: VC++ 2005 beta1 fails with pthreads benchmark tests
      ... >>> It is the last assert which fails in the first of the failing test ... >> Why should 'perror' be expected to cause an 'EGAIN' error? ... > It is not perror which sets errno ...
      (microsoft.public.dotnet.languages.vc)
    • Re: sequence points and evaluation order
      ... When it says "operand uses errno" does it mean reads ... a sequence point on calling a function, and the two calls are not ... If either call sets errno it is guaranteed that errno will ... If logis implemented as a macro, there may not be a sequence point. ...
      (comp.lang.c)
    • Re: VC++ 2005 beta1 fails with pthreads benchmark tests
      ... >> It is not perror which sets errno ... I hope it helps the developers at MS to fix the product. ...
      (microsoft.public.dotnet.languages.vc)
    • Re: Style Question - Checking for Poor Parameters
      ... reentrancy are things I have to deal with. ... >> before using errno, which could overwrite errno. ... If I call that, it sets errno, and I do ...
      (comp.lang.c)