I'm no expert on N.C. law. I didn't see where anyone linked to the statute but assume it did include the provision that it must be done knowingly and willfully as some members have posted.
The N.C. Court of Appeals has explained the difference between an act done knowingly and one done intentionally:
A person knows of an activity if he is aware of a high probability of its existence. See Black's Law Dictionary (5th ed. 1979). A person acts intentionally if he desires to cause the consequences of his act or that he believes the consequences are substantially certain to result.
State v. Bright, 78 N.C. App. 239, 243, 337 S.E.2d 87, 89 (1985). Normally, we can infer knowledge and intent from the acts themselves. However, under the facts as reported, there is direct evidence he was not aware of the gun in the trunk when he drove onto school property. Thus, a good argument can be made that the student did not knowingly bring the gun onto the school property. This has nothing to do with being charged with knowledge of the law; the law requires knowledge of the facts.
In addition, the N.C. Court of Appeals has defined willfully:
[t]he word willfully means something more than an intention to commit the offense. It implies committing the offense purposely and designedly in violation of law.”
State v. Sullivan, 201 N.C. App. 540, 548, 687 S.E.2d 504, 510 (2009) quoting a jury instruction with approval and citing
State v. Stephenson, 218 N.C. 258, 264, 10 S.E.2d 819, 823 (1940).
Thus, the student must intend to commit not just the act, but to violate the law purposely. This does not fit the facts as we know them.
This is a situation where the prosecutor may very well decide not to prosecute. Whether there would still be a school code violation which would justify expulsion is another matter.
Added: How many of you have tried to go through airline security with something not allowed like a pen knife on a key fob or a small container of CS gas on a key ring? This happens many times a day in virtually every airport. People are not prosecuted for trying to bring contraband through the airline because there is no intent to violate the law.