Identifying Dirac cones in carbon allotropes with square symmetry