Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/x/xmlto/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ package("xmlto")

on_install("macosx", "linux", function (package)
import("package.tools.autoconf")
io.replace("xmlif/xmlif.l",[[static ifsense;]],[[static int ifsense;]],{plain = true})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The original code static ifsense; uses an implicit int declaration, which is not allowed by newer compilers. Explicitly declaring the variable as static int ifsense; resolves this issue.

Suggestion: Use explicit type declaration for variables.

io.replace("xmlif/xmlif.l",[[static ifsense;]],[[static int ifsense;]],{plain = true})

io.replace("xmlif/xmlif.l",[[main(int argc, char *argv[])]],[[int main(int argc, char *argv[])]],{plain = true})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The original code main(int argc, char *argv[]) uses an implicit int return type, which is not allowed by newer compilers. Explicitly declaring the return type as int main(int argc, char *argv[]) resolves this issue.

Suggestion: Always specify the return type of the main function.

io.replace("xmlif/xmlif.l",[[main(int argc, char *argv[])]],[[int main(int argc, char *argv[])]],{plain = true})

local envs = autoconf.buildenvs(package)
local getopt = package:dep("util-linux"):fetch()
for _, dir in ipairs(getopt.linkdirs) do
Expand Down
Loading