This weekend is going to feel more like mid-July than late May, bringing renewed attention to decades-old state codes that do not address cooling in residential buildings.

The state sanitary code, the Minimum Standards for Human Habitation, says that heat must be available in all Massachusetts residential buildings from September 15 through June 15 each year. Though the law also states “the temperature shall at no time exceed 78 degrees" during that period, experts say some landlords opt to keep the heat on for the entire span — which can be harmful when the weather also heats up. Doug Quattrochi, executive director of Mass Landlords, is calling on state public health officials and lawmakers on Beacon Hill to change the heat cutoff date to the end of May.

The demand has taken on greater urgency in light of the recent, apparently heat-related deaths of three women at a senior-living high-rise building in Chicago. Chicago was in the throes of a record-breaking heat wave, and the heat was believed to be running inside the building where the women lived. Much like in Massachusetts, a Chicago city ordinance requires that heat be available through June 1.

Quattrochi said the deaths are awful and shocking.

"The codes in Massachusetts, and I think in Chicago, don't take into account that we also need air conditioning, especially in these brick buildings with urban heat islands," he said. "We've got old codes that aren't keeping up with climate change."

Among all weather-related deaths, the number-one killer in the United States is excessive heat. Data from the past three decades shows more than 140 people die due to heat each year, on average. Flooding, which has the second-highest death toll, kills an average of 85 people.

Ethan Masscoop, a clinical instructor in environmental health at Boston University, said most of Massachusetts' sanitary code was written in the '70s. He worries that a tragedy similar to what happened in Chicago could happen here, particularly in buildings with complex heating, ventilation and air conditioning systems.

"If you're living in a large building or even a semi-large building with an HVAC system, it's not always easy to switch between cooling and heat," he said. "So what happens is, since the requirement is to have heat, most buildings keep the heat mode on until June 15th."

Masscoop said there was an effort to rewrite the sanitation code in 1999, which included a provision to shorten the heating season to the end of May. "I was there for it and they've gone through a number of revisions, but it's been sitting at the State House now for a number of years," he said.

Substandard housing has the biggest challenges, he says, because so many aren't equipped with any cooling mechanisms. Plus, windows often don't open, or air conditioners could block the only entrance and exit.

"These people are really suffering," he said.

While the state sanitary code languishes, a dramatic overhaul of Mass Save, the state's leading energy efficiency program, could offer solutions. It offers tools to help customers of half a dozen utility companies reduce their energy costs and help reach the state's goal of net-zero emissions in the next three decades. Part of that push includes rebates to install electric heat pumps on residential properties.

"There's a real opportunity right now because of huge incentives to invest in electric heat pumps to get to net-zero emissions by 2050," Quattrochi said. "The side effect is that the heat pumps come with air conditioning."

Quattrochi said landlords still need policy help. "Nobody wants to go to a cooling center any more than people want to go to a homeless shelter. People want to have a home that they can live in that's suitable.

He said landlords who shut off their buildings' heat in the face of extreme heat are unlikely to be cited, even when temperatures might dip below the state codes in late May.

"The lesson from Chicago is: any landlord who gets a complaint about a building being too hot, especially if there are seniors in the building, that's an emergency — the same as no heat in the winter," Quattrochi said. "The real issue here, when these buildings start to really get hot, is it's much more serious than being at 50 degrees at night. You can always put on a blanket, right? But if you're too hot and you can't cool off, there's nothing you can do."