On 06/22/2016 04:37 PM, Jim Meyering wrote: > Building with a recent gcc-7 failed, so I wrote the attached patch. I > think we'll never have 2^31 command line arguments I would rather fix the code so that it works even if argc is initially INT_MAX; the code currently has undefined behavior in that case. I have drafted a patch for this (attached; does not have changelog entries yet) and will test it a bit. I assume this will fix the warning (don't have gcc-7 offhand so can't test this). As the patch shows, a couple of other coreutils programs have a similar bug; I'm a bit surprised gcc-7 didn't complain about them. Incidentally, 'yes' has a different bug: it mishandles the case where 'write' succeeds but returns a value less than the buffer size. I'll try to look into that too. Simplest would be to use stdio (the comments indicate this has performance issues but I don't know what they are, anyway correctness trumps performance).