Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thiago A. Corrêa" <thiago.correa@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] Qtopia4 Failure
Date: Mon, 24 Sep 2007 02:41:24 +0100	[thread overview]
Message-ID: <d6cda7730709231841v7ce7eec2qa801e54b049763b7@mail.gmail.com> (raw)
In-Reply-To: <1190595992.4299.27.camel@cyclops.infocab.com.au>

Sure. There are all sort of valid code that a define breaks:

class MyClass
{
    MyClass() : index( 0 )
    {}
};

class MyOtherClass
{
    int index() const { return 0; }
}


A define claims the name index as if it were a keyword. It is a well
known issue.

How about change it to a function that wrapps the strchr()?
According to this:
http://www.opengroup.org/onlinepubs/000095399/functions/index.html
it used to be a function anyway.

At least it would give the compiler a chance to figure out by the scope.

One other good solution would be to patch mplayer not to use this define.


On 9/24/07, Adam Hawes <adam@infocab.com.au> wrote:
> On Mon, 2007-09-24 at 01:56 +0100, Thiago A. Corr?a wrote:
> > shouldn't you patch uClib instead? Claiming index with a define is
> > really stupid on the part of the library. Others, including myself use
> > index as variable names quite often.
>
> Do you use index()?  The macro accepts 2 arguments and the pre-processor
> only seems to baulk when you use a function or method called index(...).
> Variable names appear unproblematic.
>
> Fixing uClibc would be the sensible thing to do, and uClibc actually has
> a configuration option to turn off the legacy macros.  Turning them off,
> however, breaks compatibility with a few things (mplayer was the most
> recent one I found that wouldn't build with SUSv3 macros disabled).
>
> I found it easier to patch Qtopia because it was the only thing that
> didn't like the macros that I have found thus far.
>
> So please keep in mind that there is not one universal solution - there
> are a few options depending on the needs.  My patch fixes Qtopia for
> those people who need the SUSv3 legacy macros in other places.  For
> everyone else there's the configuration option of the library!
>
> Regards,
> A
>
>
>

  reply	other threads:[~2007-09-24  1:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-23 16:12 [Buildroot] Qtopia4 Failure Ulf Samuelsson
2007-09-23 16:25 ` Thiago A. Corrêa
2007-09-23 23:55 ` Adam Hawes
2007-09-24  0:56   ` Thiago A. Corrêa
2007-09-24  1:06     ` Adam Hawes
2007-09-24  1:41       ` Thiago A. Corrêa [this message]
2007-09-24  2:16         ` Adam Hawes
2007-09-24  3:43           ` Thiago A. Corrêa
2007-09-24  3:55             ` Adam Hawes
2007-09-24  8:13               ` Bernhard Fischer
2007-09-24 12:59                 ` Thiago A. Corrêa
2007-09-24 13:22                   ` Bernhard Fischer
2007-09-24 15:13                     ` Ulf Samuelsson
2007-09-24 15:34                       ` Thiago A. Corrêa
2007-09-24 23:31                     ` Adam Hawes
2007-09-25  0:09                       ` [Buildroot] MPlayer using LEGACY Functions (was: Qtopia4 Failure) Adam Hawes
2007-09-25  7:27                       ` [Buildroot] Qtopia4 Failure Bernhard Fischer
2007-09-24  8:12             ` Ulf Samuelsson
2007-09-24  9:12               ` Bernhard Fischer
2007-09-24  9:34                 ` Ulf Samuelsson
2007-09-24 12:27                   ` Bernhard Fischer
2007-09-24 14:25                     ` Ulf Samuelsson
2007-09-24 14:51                     ` Ulf Samuelsson
2007-09-24 18:41                       ` Bernhard Fischer
2007-09-24  8:06       ` Ulf Samuelsson
2007-09-24  8:02   ` Ulf Samuelsson

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=d6cda7730709231841v7ce7eec2qa801e54b049763b7@mail.gmail.com \
    --to=thiago.correa@gmail.com \
    --cc=buildroot@busybox.net \
    /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