Older blog entries for redi (starting at number 189)

After a few years with Write After Approval status, I have been made a maintainer of libstdc++. I am replacing Phil Edwards who has not been as active as he once was. Phil was very supportive and helpful when I first got involved with libstdc++ so as well as my own work I'll try to follow his example and encourage new contributors to the project.

I wiped the default Asus/Xandros distro from my EeePC 701 a couple of months ago and installed Fedora 11. That borked my mobile broadband, which made the system pretty much useless for me as I only use the eee when on the move. Since the machine was just gathering dust and Fedora 12 has improvements to mobile broadband support, I thought I might as well try the Fedora 12 beta. Mobile broadband works again and is very simple to start, the NetworkManager UI is much better than the applet I used to use with the original Asus distro. There were a couple of small issues which have already been fixed in rawhide, but generally it works very well. I've been using LXDE and XFCE for the desktop, as KDE is very slow on the eee 701, even with the RAM upgraded to 1GB. Newer netbooks with slightly more powerful CPUs might fare better.

On the same topic as dmarti's How not to write the way dumb people think smart people write, I have been getting annoyed with dumb people who say they will "revert back to me."

That's doubly dumb, because "revert back" is tautological, and because "revert" doesn't mean "reply".

Unless you're the Incredible Hulk talking to Bruce Banner in the mirror, you should not say you will revert to someone.

This misuse appears to have originated in India, but has infected the minds of several people in the UK who seem to think it's a professional-sounding way to finish emails. Thankfully there appear to be attempts to stop the misuse, e.g. hamra.net and englishyogi.com.

I wish advogato's diary entry form didn't wrap <pre> elements at 60 characters.

10 Aug 2009 (updated 10 Aug 2009 at 17:54 UTC) »
error: template parameters not used in partial specialization:

Dear search engines,

please direct people to this explanation if they search for the GCC error template parameters not used in partial specialization.

An undocumented change to GCC 4.3 means that g++ now rejects some invalid template partial specializations that used to be accepted.

Examples of code that used to be accepted can be found in bugs 35989 and 41028. GCC was wrong to accept them, and is now fixed.

Here is an example that compiled with GCC 4.2 but is rejected by GCC 4.3 and later:

#include <vector>
#include <cassert>
template<typename T>
  struct A
    static const bool value = false;
template<typename U>
  struct A<typename std::vector<U>::iterator>
    static const bool = true;
int main()
  assert( !A<int>::value );
  assert( A<std::vector<int>::iterator>::value );

The meta-function A attempts to detect when its template argument T is the iterator type belonging to std::vector<U> for some type U, by providing a partial specialization to match vector iterator types.

GCC 4.2 and earlier will compile this code, but the second assertion will fail:

a.out: t.cc:19: int main(): Assertion
`A<std::vector<int>::iterator>::value' failed.
Aborted (core dumped)
The partial specialization is not used!

GCC 4.3 will determine that the partial specialization will never be used, so will not compile it:

t.cc:11: error: template parameters not used in partial
t.cc:11: error:         'U'

Looking at the partial specialization it seems that U is used, so let's look at why the code does not work. The C++ standard says, in [temp.class.spec.match] paragraph 2:

A partial specialization matches a given actual template argument list if the template arguments of the partial specialization can be deduced from the actual template argument list
So in order for an instantiation, A<X>, to match the partial specialization, the compiler must be able to deduce the type U from X. In the example above, X is std::vector<int>::iterator, so why can the compiler not deduce U as int?

The rules for deducing template arguments from types in [temp.deduct.type] say that template arguments can only be deduced in certain contexts, and that in other contexts the actual template arguments do not participate in type deduction. U appears in the nested-name-specifier of the qualified-id std::vector<U>::iterator, and this is defined as a nondeduced context by paragraph 4.

The compiler cannot deduce U when instantiating the template, so the partial specialization is ill-formed.

The more persistent and curious might wonder why that is a nondeduced context. Well, consider that to match X with some std::vector<U>::iterator the compiler would have to instantiate vector with an arbitrary number of types (maybe every type in the program!) to see if there is a nested type iterator that matches X. Performing all those instantiations could involve an arbitrary number of partial and explicit specializations of vector and not only would many of those instantiations fail (resulting in errors that must be suppressed via SFINAE) but the compilation would require huge amounts of time and memory. Parsing C++ templates is complicated enough already, so the compiler doesn't even try to perform this particular miracle.

Oi! lkcl, stop syndicating spam from kerneltrap!

sneakums pointed it out first, please fix it as "your" last two diary posts are taking the piss.

8 Jul 2009 (updated 8 Jul 2009 at 09:44 UTC) »
ncm, although that could be one advantage, the real cost is likely to be much less than half a billion and whatever it costs, Google can profit from YouTube in other ways.
Oh the ironing!

how ironic that the Adecco NZ homepage, linked to by spammer Adecconz101, has a large banner leading to a page warning about spam.

I suggest emailing the given address to point out that whoever they've hired to do SEO for their site is spamming unrelated websites. That might get them fired.

Whoever signed up the Adecconz101 account is so inept that they got the website address wrong in the 'Homepage' field. It's .co.nz not .com.nz - SEO FAIL.

I'll post a real diary update soon, covering my ongoing <future> work for libstdc++.

27 May 2009 (updated 27 May 2009 at 14:30 UTC) »

Spam attack! All the accounts certifying pinkurath are the same spammer.

Update: They're gone now, either robogato stepped in or the massed ranks of advogato users saw them off. Nice.

Deleted spammer cupid was trying fairly hard to not look like a spammer (apart from claiming to be a writer and being unable to spell) but a quick google revealed that all the content was stolen from other sites.

Nice try, spammer. Now kill yourself. Seriously.

All spammers and SEO scum should be drowned in a septic tank.

I wonder what percentage of www content consists of SEO diarrhoea stolen from press releases, two-bit research companies and unknown/unread/uninteresting bloggers.

15 May 2009 (updated 15 May 2009 at 12:53 UTC) »
  • Behold, the <future>.

  • L'Enfer, c'est le code des autres.

  • Bullshit overflow detected - MS adds memcpy to the blacklist in their False-Sense-of-Security-Enhanced C library

180 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!