There has been a great confusion amongst some Catholics, and Protestants to identify what statements made the popes are infallible.
Jimmy Akin provided an very clear explanation what statements are infallible and which are none. He quotes Canon Law.
Here a link:
Here are some excerpts:
Many people have a difficult time discerning when the magisterium has engaged its infallibility and when it hasn’t. Recently, I came across an instance where a was trying to make hay with the papal bull Exsurge Domine, and I thought the case might be instructive for seeing the delicacy with which such matters have to be treated.
Exsurge Domine (which takes its name from the first two Latin words of the document’s opening sentence: “Arise, Lord, and judge your own cause”) was the 1520 papal bull rejecting forty-one propositions from Martin Luther’s writings. It threatened Luther—who was still a Catholic at the time—with excommunication if he did not repent.
This Jehovah’s Witness claimed that Exsurge Domine was a document for which papal infallibility had been engaged and that it contained error—specifically, in its rejection of the proposition “That heretics be burned is against the will of the Spirit.” This, he argued, made Exsurge Domine a fallible “infallible” document and was evidence against the doctrine of papal infallibility.
There are several ways to resolve this supposed dilemma. One would be to affirm that sometimes it is the will of the Spirit to put heretics to death. After all, didn’t God on some occasions command the use of capital punishment for certain offenses connected with false religion (Ex. 22:18, 20; Deut. 13:5, 8–10, 15, 18:20)? Another would be to point out that when the Church censures a proposition, it means the Church finds something about the proposition problematic. But since the proposition is phrased in the offender’s own words, it is often phrased badly, and so one cannot take the Church’s position to be the opposite of the offending proposition. For example, if the Church chose to condemn the proposition “The sky is white,” one could not then infer that the Church adhered to the proposition “The sky is black.”