  Conflict-avoiding codes are used in the multiple-access collision channel
without feedback. The number of codewords in a conflict-avoiding code is the
number of potential users that can be supported in the system. In this paper, a
new upper bound on the size of conflict-avoiding codes is proved. This upper
bound is general in the sense that it is applicable to all code lengths and all
Hamming weights. Several existing constructions for conflict-avoiding codes,
which are known to be optimal for Hamming weights equal to four and five, are
shown to be optimal for all Hamming weights in general.
