Not had chance to try this on my D40 but just put a manual lens on a D80 -- which should behave the same.
The D80 flashes F-- in any of the (semi-) auto modes A, S, ...
Switch to manual M mode and the F-- still shows but stops flashing.
I was indoors with just a 60w bulb for light so, guessing the exposure, set the lens wide open with a slow shutter speed and it took the photo fine.
---
ok, found a D40 manual and it suggests it should work the same.
BTW if you're using your 18-55, you'll have no control over the aperture from the camera -- you'd normally use the aperture ring on a manual lens.