W. Irving Earnshaw, 83, a retired mechanical engineer with the General Services Administration, died of a heart attack Sunday at his home in Mitchellville, Md.

After his retirement in 1957, he continued to work for a number of years as a consultant to private industry here.

Mr. Earnshaw was born in Washington. He began his career in engineering as an apprentice machinist at the old Naval Gun Factory in Washington in 1912.

He helped design and build a 14-inch railway gun and then was sent to France on military duty to operate it with one of the Navy's five long-range railway gun batteries in World War I.

After the war, Mr. Earnshaw returned to Washington and worked for several government agencies that eventually were combined into the GSA. As a mechanical engineer, he helped design plumbing, heating and ventilating systems for government buildings. He also studied at George Washington University.

A resident of Hyattsville from 1925 until moving to a farm in Mitchellville in 1941, Mr. Earnshaw had served on the Hyattsville City Council for five years.

He was an active member of the Mount Oak United Methodist Church in Mitchellville.

He is survived by his wife, Myrtle, of the home; three children, Dr. Herbert I., of Landover Hills, Doris Windle, of Pullman, W. Va., and William R., of Orlando, Fla., and nine grandchildren. CAPTION: Picture, W. IRVING EARNSHAW