If I do echo foo bar baz | grep -o -w baz the output is foo bar baz (and an extra newline).
The expected output would be baz as the -o option should only display the matched part.
I'm using Mac OS X 10.7.1 and the grep version is grep (GNU grep) 2.5.1

Before reporting a bug to GNU, you should check whether more recent versions and home-compiled binaries have the same issue. I doubt GNU would appreciate a bug report if the problem turned out to be the way Apple built the binary, or if the issue has been fixed a long time ago.
–
GillesAug 21 '11 at 1:21