gcc 4.8.1 made it to Debian Sid

Iain Buclaw ibuclaw at ubuntu.com
Wed Jul 10 03:56:01 PDT 2013


On 10 July 2013 11:47, Joseph Rushton Wakeling
<joseph.wakeling at webdrake.net> wrote:
> On 07/10/2013 12:28 PM, Iain Buclaw wrote:
>> On 10 July 2013 11:24, Joseph Rushton Wakeling
>> <joseph.wakeling at webdrake.net> wrote:
>>> On 07/10/2013 02:07 AM, H. S. Teoh wrote:
>>>> Comments / flames / pull requests welcome. ;-)
>>>
>>>     string findGDC(string argv0)
>>>     {
>>>         // FIXME: this does not work 100% of the time.
>>>         auto c = match(baseName(argv0), `^(.*-)?g?dmd(-.*)?$`).captures;
>>>         auto targetPrefix = c[1];
>>>         auto gdcDir = absolutePath(dirName(argv0));
>>>         return buildNormalizedPath(gdcDir, targetPrefix ~ "gdc" ~ c[2]);
>>>     }
>>>
>>> The "obvious" solution is to have a gdmd.conf file which specifies what gdc
>>> executable to use and where to find it.  This should get round problems such as
>>> gdc being installed in /opt/gdc/bin and gdmd being in /usr/local/bin.
>>
>> Search all bin locations in $PATH for ./gdc - I'd imagine this is how
>> Perl's FindBin works...
>
> In this case you need to take account of the possibility of multiple gdc/gdmd
> versions being installed in different places.  So, ideally, a given install of
> gdmd should be wedded to a given gdc.

You think too hard about things that simply don't matter. You should
instead match behaviour of how shells such as bash or csh work when
there are more than one executable named 'foo' in /bin, /usr/bin, and
/usr/local/bin.

Incase you weren't aware, it is first match wins.


--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the D.gnu mailing list