check undeclared pragma in the entire stack