I agree with the conclusion in your linked SO answer: the GPLv2-licensed
wsdl2h generates code that is licensed under GPLv2 also. Therefore you cannot use unlicense on the output. If you link said code with any other code, the whole program must also be GPLv2.
Don't just take my, or the linked answer's, words for it. The gSOAP site says so itself (emphasis mine):
gSOAP and GPL
If you use gSOAP under the GPL v2 to integrate parts of it or code generated by it with your own code, then you are allowed to sell copies of the modified program commercially, but only under the terms of the GNU GPL v2. Thus, for instance, you must make the source code available to the users of the program as described in the GPL, and they must be allowed to redistribute and modify it as described in the GPL. These requirements are the condition for including the GPL-covered code you received in a program of your own. These restrictions may hamper certain proprietary software development scenarios. If you do not wish for your program to be released under a GPL-compatible open source license, then an alternate proprietary software license for gSOAP which will remove the aforementioned requirement is available from Genivia Inc. The gSOAP software does not include any third-party GPL code. All software was build from the ground up. Note that the GNU Bison and Flex tools are used to generate source code for the gSOAP soapcpp2 compiler. However, the Bison/Flex-generated source code is not restricted by the GPL or LGPL terms. Non-GPL third-party contributions are included in the 'extras' directory in the package and you are free to use these contributions. Suggested changes and improvements by vendors were accepted under the public gSOAP license (not GPL), which includes support for VxWorks and Apache and IIS modules for gSOAP.
Note that in the same text they mention you can obtain a proprietary license from them. This is probably part of their business model.
The reason why this is the case, but not in general for GPL programs (like text editors, browsers etc.) is explained in the GPL FAQ, linked in Phillip's answer. The key is whether the program copies part of itself into the output.
Some GPL programs, such as GNU bison and GCC, copy parts of themselves into the output, but their output isn't GPL licensed, because they provide an exception in their license.
This isn't some weird GPL thing; even proprietary programs offer similar exceptions. For example, Microsoft Office has a license exception on their document templates, so that the templates remain under Microsoft's copyright, but you can use them to create your own documents under relatively free terms (e.g. you can't "create obscene or scandalous works").