I'd say you could use 235 40's without rubbing issues but i suppose that depends on the offset of your wheels and if your car has been lowered. No probs on a bog standard car though with the right wheels.
All speedos are set to read more mph than you're actually doing so running a larger diameter tyre that more closely matches what the speedo says is not a bad thing. Rather go very slightly over than further under or stay the same.
Standard wheels are 215/45R17. 225/40R18 will be ~2mm more and 225/35R18 ~2mm less than overall diameter of standard ones which gives around 1.5% difference in speedometer readings either way.