linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yura Pakhuchiy <pakhuchiy@gmail.com>
To: linux-sparse@vger.kernel.org
Subject: support of __restrict and __constructor__
Date: Thu, 05 Jul 2007 20:52:55 +0300	[thread overview]
Message-ID: <1183657975.5958.46.camel@pc299.sam-solutions.net> (raw)

Hi,

I updated libntfs/ntfsprogs to use sparse for checking endianness.
Thanks much for this feature, it very useful. Helped to find several
bugs in our project.

The only problem is 2 annoying lines in glibc and gnupg headers that
sparse-0.3 do not like:
1. Sparse do not like __restrict_attr inside regexec() definition in
   regex.h. Relevant code:

   extern int regexec (const regex_t *__restrict __preg,
                    const char *__restrict __string, size_t __nmatch,
                    regmatch_t __pmatch[__restrict_arr],
                    int __eflags);

   Produces following error: 
   /usr/include/regex.h:543:27: error: typename in expression
   /usr/include/regex.h:543:27: error: undefined identifier '__restrict'
   /usr/include/regex.h:543:27: error: bad constant expression type

   (Note: __restrict_arr is defined to __restrict)
2. And sparse do not know about attribute __constructor__ inside
   gpg-error.h. Relevant code:

#if _GPG_ERR_GCC_VERSION > 30100
#define _GPG_ERR_CONSTRUCTOR    __attribute__ ((__constructor__))
#define _GPG_ERR_HAVE_CONSTRUCTOR
#endif
#endif

#ifndef _GPG_ERR_CONSTRUCTOR
#define _GPG_ERR_CONSTRUCTOR
#endif

/* Initialization function.  */

/* Initialize the library.  This function should be run early.  */
gpg_error_t gpg_err_init (void) _GPG_ERR_CONSTRUCTOR;

I would really happy if you will fix this. Thanks!

-- 
Best regards,
        Yura

             reply	other threads:[~2007-07-05 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-05 17:52 Yura Pakhuchiy [this message]
2007-07-05 19:04 ` support of __restrict and __constructor__ Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1183657975.5958.46.camel@pc299.sam-solutions.net \
    --to=pakhuchiy@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).