On Mon, 10 Oct 2022 14:15:37 GMT, Julian Waters <jwat...@openjdk.org> wrote:

> Some external libraries required by native code are linked via linker 
> comments embedded in pragmas. Searching for which libraries are linked can 
> then become frustrating and confusing since they may be included in an 
> obscure place, and for all relevant compilers there is no difference between 
> specifying them from make and in a source file. The easiest solution is to 
> just always link them from make and remove any source level linkage.

I don't agree with the justification here. This seems very windows specific but 
I like the idea that the source code tracks its own library dependencies. If I 
am writing some windows code that uses a particular Windows API which in turn 
requires a specific windows library, then these pragma comments seem an ideal 
way to express that dependency. This has the advantage that (a) the developer 
doesn't require detailed knowledge of the build system to make things work; and 
(b) there is more chance that if the code is later removed then removing the 
linking of the library will not get overlooked.

YMMV.

-------------

PR: https://git.openjdk.org/jdk/pull/10633

Reply via email to