The 6-foot-10 McRoberts, who played at Duke, has appeared in 41 games this season with three starts and is averaging 3.9 points and 3.7 rebounds.
Warrick, in his eighth NBA season, was acquired earlier this season in a trade with the New Orleans Hornets. Since joining the Bobcats, he has averaged 6.9 points per game and 3.2 rebounds, but has played in only one of the team's past 11 games.
The Bobcats were unable to unload veteran guard Ben Gordon, who is due $13 million under next year's salary cap. Gordon and first-year coach Mike Dunlap have clashed at times this season.
"Josh McRoberts is a quality young big man who can play either post position for us," said Bobcats president of basketball operations Rod Higgins. "We look forward to adding his size and energy to our rotation."
In his sixth NBA season, McRoberts has career averages of 4.5 points, 3.7 rebounds and 1.4 assists, along with a career field goal percentage of .496 in 246 games played for the Trail Blazers, Pacers, Lakers and Magic.
Earlier this season he posted career highs of 14 rebounds on Nov. 25 against Boston and eight assists on Jan. 7 at Portland.
McRoberts was originally selected with the 37th overall pick in the 2007 NBA draft by the Trail Blazers after two years at Duke, where he was a teammate of Bobcats guard Gerald Henderson during the 2006-07 season.
He had his best overall season in 2010-11, when he averaged career highs of 7.2 points, 5.4 rebounds, 2.1 assists and 22.2 minutes in 72 games played for the Pacers, including 51 starts.