Lattice constants of gallium nitride (wurzite structure) have been measured at temperatures 294-753 K. The measurements were performed by using x-ray diffractometry. Two kinds of samples were used: (1) bulk monocrystal grown at pressure of 15 kbar, (2) epitaxial layer grown on a sapphire substrate. The latter had a smaller lattice constant in a direction parallel to the interface plane by about 0.03%. This difference was induced by a higher thermal expansion of the sapphire with respect to the GaN layer. However, this thermal strain was created mainly at temperatures below 500-600 K. Above these temperatures the lattice mismatch in parallel direction diminished to zero at a temperature of about 800 K.