No, you will not necessarily be responsible for deficiencies in codes or permits. You should disclose everything you know about the problems or lack of permits. If you don’t tell the buyer, then you could be liable for fraud. If you do disclose, then it will be up to the buyers to decide if they are willing to purchase the property as is, and do any necessary repairs, etc. themselves.The buyer can always ask for you to do the work, but you can refuse. As long as the buyer is aware of the problem, then they are moving forward in the transaction with their eyes wide open.
On the other hand, if your property is not selling due to the deficiences, then you may want to consider rectifying the problems yourself in order to sell it. And sometimes certain lenders will not give financing on a property that has permit/code problems. FHA is one of those lenders. So if buyers can’t get financing, then you need an all cash buyer or you may want to fix the problems or pull the permits in order to sell.