Second-order optimality conditions for nonsmooth mathematical programming