logoalt Hacker News

time4tealast Sunday at 8:14 PM2 repliesview on HN

The point really was that the unused method parameter should in almost all cases be removed, not that some trick should be used to make it seem used, and this is the wrong trick!


Replies

addaonlast Sunday at 9:13 PM

Sometimes. But sometimes you have a set of functions that are called through function pointers that need the same signature, and one or more of them ignore some of the arguments. These days I’d spell that __attribute__((unused)); but it’s a perfectly reasonable case.

bluGilllast Monday at 10:10 AM

    #if otherbuild
        dosomething(param);
     #endif
the above type of thing happens once in a while. nos the paramater is needed but the normal build doesn't use it