The three compounds commonly found in antacids are the basic salts of magnesium, aluminum and calcium. These compounds work by neutralizing stomach acid to relieve heartburn or mild dyspepsia. Taking antacids for a long time must be avoided because of potential unwanted side effects.
The major side effect of taking magnesium hydroxide is diarrhea. Calcium carbonate can cause the side effect of constipation. There have also been cases of hypercalcemia and kidney failure for some people taking calcium carbonate for a long time, reports the New York Times. Antacids containing aluminum may also cause constipation. Large doses of this antacid, however, may cause calcium loss, osteoporosis and kidney failure.