Leader of Birmingham.pm [pm.org] and a CPAN author [cpan.org]. Co-organised YAPC::Europe in 2006 and the 2009 QA Hackathon, responsible for the YAPC Conference Surveys [yapc-surveys.org] and the QA Hackathon [qa-hackathon.org] websites. Also the current caretaker for the CPAN Testers websites and data stores.
If you really want to find out more, buy me a Guinness
Links:
Memoirs of a Roadie [missbarbell.co.uk]
[pm.org]
CPAN Testers Reports [cpantesters.org]
YAPC Conference Surveys [yapc-surveys.org]
QA Hackathon [qa-hackathon.org]
mysub( key, sprintf( "%s/%s/%s", x, y, z ) );
The compiler reported a syntax error before the ';'. If you've been doing C regularly recently, it will be an easy spot. If you're a now ex-C programmer, who hasn't been a C programmer for over 5 years and in that time has exclusively been a Perl programmer, will wonder why it doesn't JFDI
The problem for non C programmers, is that Perl and C use sprintf in different ways. The correct syntax is the first comment reply.
It took me far too long to figure that one out. It was made all the more frustrating by the fact Ubuntu doesn't have 'lint', Synaptic couldn't find one and even Google drew a blank. I could find lint checkers for virtually every other language and things like DNS, but not for C. This was once one of the key tools in my programming arsnal, alongside vi, make and cc, and would have helped me solve the above problem in seconds, but now seems to have vanished from sight. I was expecting to find a GNU version, but have drawn a complete blank. Anyone know of a decent lint checker for C?
Answer (Score:2)
Re:Answer (Score:1)
Re:Answer (Score:2)
sprintfsyntax is different between Perl and C.Re:Answer (Score:2)
Re:Answer (Score:2)
sprintfsyntax that I was highlightingRe:Answer (Score:2)
Re:Answer (Score:2)
And the complete version: (Score:1)
That assumes you have
errxandasprintfof course, but they’re reasonably portable.Splint (Score:2)
The gcc folks reckon that -Wall should be good enough though.
-Dom
Re:Splint (Score:2)
Re:Splint (Score:2)
In practise, I just compile with "-g -pipe -Wall", and it complains about quite a lot. The "-pipe" probably isn't necessary these days, but I'm a creature of habit.
-Dom
ubuntu lint (Score:1)
As far as Ubuntu goes, you're absolutely right. The Ubuntu repo doesn't seem to have a copy.
The thing to do then (he said, confidently) is to add more repositories to your list. Namely, a few Debian repositories. Now, I probably should tell you that this step isn't recommended (and people on the forums actively advise against it). The reason is that it's easy to upgrade something "core" and bork the system.
splint doesn't fall into this category, however. I added Marillat's archive (http://ubuntuguide.or [ubuntuguide.org]
Re:ubuntu lint (Score:2)