Am 23.11.2011 01:51, schrieb Peter Chubb: >>>>>> "Peter" == Peter Chubb <peter.ch...@nicta.com.au> writes: > > > Peter> All comments received so far have been addressed --- I've added > Peter> a macro, `scream' that gives at most 10 lines of output for OS > Peter> error reporting. > > Except I noticed a thinko in the macro. The decrement should be > inside the guard, thus: > > #define scream(fmt, args...) \ > do { \ > static int printable = 10;\ > if (printable) { \ > printable--;\ > fprintf(stderr, fmt, ##args); \ > } \ > } while (0)
Another issue: scream("black"); scream("black"); scream("black"); scream("black"); scream("black"); scream("black"); scream("black"); scream("black"); scream("black"); scream("black"); scream("red"); To show us "red", in addition to the integer count a duplicate of the string contents would need to be stored and compared to the newly formatted string. If we want to do this, it should go into a central file so that it can be reused and centrally maintained. Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg