Tag Archives: Development

Badly punctuated parameter list in #define

Sometimes working with an old c compiler brings up painful, yet fun-filled days of making it speak the same language as you, and sometimes you just go “*$&%*$#&% you piece of sh** compiler”

I had one such moment today, and after I had returned to Zen (some soul-searching and some google searching), I realized it quite simple.


$ gmake
...
...
some_file.h:42: badly punctuated parameter list in `#define'
some_file.h:64: badly punctuated parameter list in `#define'
Failed to compile
$

This was caused by the following:


file: some_file.h
-----------------
...
...
#define LOG(...) {\ printf (##__VA_ARGS__); \
}
...
...

This works in most modern C compilers. However, if you happen to use one from the 80s (I exaggerate a little – not by much), it throws the error as above. You can fix this as follows:


file: some_file.h
-----------------
...
...
#define LOG(ARGS...) {\ printf (##ARGS); \
}
...
...

Source : http://nixscripts.blogspot.com/2010/09/badly-punctuated-parameter-list.html

cvs – Getting list of files changed in the current tree

The simple way to retreive the list of changed files would be to update the tree, which would then list the files updated.

#cvs update . > filelist.dat

The problem with this, is that if there have been changes to other files after your last update, you will have to manually glean the files that you have changed. I tend face this, particularly during the last couple of weeks before a release, since you don’t want to risk updating your tree everyday, but still have to make 2/3 checkins. I did some googling today, and found how to find the list of files changed without updating your tree.

#cvs -n update . > filelist.dat

Thanks Jonnay for this. I should used man before I googled, but hey, I’m lazy today :)

EX-SideRSS

After several months of keeping away from updating or changing my website, I broke the fast today. I found a wonderful plugin, sideRSS, which allows display of RSS feeds within a blog’s sidebar. As usual, I needed a specific functionality that was not supported the way I wanted it. I hacked it a little bit, renamed the plugin, and posted a custom version for download on my website.

If you need to share Google Shared Items, on your blog, but hate to include javascript (like I do), then use this. You can download it here (right-click and use “Save Target As…”) and find install information here.

Also, if you like this version, and would like me to add a few more features (I have some in mind though, like ATOM parsing), do suggest them in the comments section.

P.S: If you are Chris Hatcher, the author of the original SideRSS, and want to take this version down or something, just leave a message here – you will need to merge my changes in your code though :-)

Technorati Tags: , ,