Some remarks on second-order optimality conditions