French Open champion and fourth seed Wawrinka beat ambitious Korean youngster Hyeon Chung in straight sets – albeit all three going to a tie break – to take his place in the next round.
World number two Federer, seeking his first US Open title since 2008 and first Grand Slam crown since Wimbledon in 2012, needed only 80 minutes to rout Belgium's Steve Darcis 6-1, 6-2, 6-1.
“It was on the easier side, so I was able to mix it up, was attacking, was also staying back some. I was pretty much all-out attack as much as I could.”
Next up for the Swiss star will be German 29th seed Philipp Kohlschreiber.
Federer showed he still has what it takes to contend for a title by reaching July's Wimbledon final, losing to top-ranked Novak Djokovic.
But as he bid a US Open farewell to a retiring rival who is also 34, Australian Lleyton Hewitt, Federer said he has no idea when he might decide to call it quits.
“No, not really,” he said. “I wish I knew. It would make my life easier. But I don't.
“This year is another good year. Doing the right things on the court.”
Federer praised Hewitt, who won the 2001 US Open and 2002 Wimbledon crown, as a player who taught the Swiss star some lessons that helped him win his first Slam title at Wimbledon in 2003.
“He was a big challenge in my career, to understand how in the world can you be so tough physically and mentally at such a young age,” Federer said.
“I think he really changed things around and showed me how it's done. He made me work harder in practice, get my act together on the court, play tough but fair.”
The two even played doubles together a few times.
“I thought he changed the game to some extent,” Federer said of Hewitt.
Federer said he has mixed stubborness with knowing he needs to change and adapt in order to keep finding success after missing out on any Slam final in 2013 for the first year since 2002.
“You can be stubborn and successful or you can give it up a bit and change things around. For me it's important to have a bit of both,” he said.
“You need to be stubborn, believe in hard work that somehow down the stretch is going to pay off. You need that stubbornness to succeed.
“Also I think the idea of change is really important because otherwise it can become a bit boring to some extent. I think you need to challenge yourself and try out new things.”
One change Federer has made is moving to the service line at times on returns.
“I've had reactions. I think many players think it's quite funny, actually, especially the guys who I practiced with and I tried it against,” Federer said.