In the attached program, I confused "ensures" and "assert" in the contract of p() in line 20. However, the syntax error message refers to 5 lines below (i.e. line 25). If the error is moved e.g. to line 10 the message refers to line 15.

Usually there is other C- or Acsl-code after the error; the message is rather confusing in that cases.

Trying to reproduce the behavior with "frama-c ftest.c", I got the error report referring to line 21, as you did.
However, trying "frama-c -jessie ftest.c", I still get it at line 25.
"frama-c -wp ftest.c" reports at line 21 again.

My frama-c version just employed is Nitrogen-20111001.
My ocaml version is reported as 3.12.1 by the command "ocaml -version".