linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: linux-sparse@vger.kernel.org, torvalds@linux-foundation.org
Subject: Re: [PATCH] sparse: Add GCC pre-defined macros for user-space
Date: Sat, 15 Aug 2009 12:36:37 -0700	[thread overview]
Message-ID: <70318cbf0908151236q2c691d73n5114ab21f3cbd819@mail.gmail.com> (raw)
In-Reply-To: <1250348235-19691-1-git-send-email-penberg@cs.helsinki.fi>

On Sat, Aug 15, 2009 at 7:57 AM, Pekka Enberg<penberg@cs.helsinki.fi> wrote:
> +       } else if (token->ident == &__SHRT_MAX__ident) {
> +               replace_with_integer(token, __SHRT_MAX__);
> +       } else if (token->ident == &__SCHAR_MAX__ident) {
> +               replace_with_integer(token, __SCHAR_MAX__);
> +       } else if (token->ident == &__INT_MAX__ident) {
> +               replace_with_integer(token, __INT_MAX__);
> +       } else if (token->ident == &__LONG_MAX__ident) {
> +               replace_with_integer(token, __LONG_MAX__);
> +       } else if (token->ident == &__LONG_LONG_MAX__ident) {
> +               replace_with_long_long(token, __LONG_LONG_MAX__);
> +       } else if (token->ident == &__WCHAR_MAX__ident) {
> +               replace_with_integer(token, __WCHAR_MAX__);


I am pretty sure that is not the way to do it in sparse.  If you just want
add some sparse builtin defines, it is much better to add them in
create_builtin_streams(). It would be even better to group them in a new
function create_builtin_define():

Some thing like:

add_pre_buffer("#weak_define __INT_MAX__ %d\n", __INT_MAX__);

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-08-15 19:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-15 14:57 [PATCH] sparse: Add GCC pre-defined macros for user-space Pekka Enberg
2009-08-15 19:36 ` Christopher Li [this message]
2009-08-15 20:26   ` Pekka Enberg
2009-08-15 22:36     ` Josh Triplett
2009-08-16  7:03       ` Pekka Enberg
2009-08-16 10:51         ` Josh Triplett
2009-08-16 11:05           ` Pekka Enberg
2009-08-16 12:41             ` Josh Triplett
2009-08-16 17:50               ` Christopher Li
2009-08-16 18:56                 ` Josh Triplett
2009-08-16 19:34                   ` Johannes Berg
2009-08-16 20:00                     ` 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=70318cbf0908151236q2c691d73n5114ab21f3cbd819@mail.gmail.com \
    --to=sparse@chrisli.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=torvalds@linux-foundation.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).