You are not logged in.

#1 2019-06-25 09:37:30

systemdeedeedee
Member
Registered: 2019-06-25
Posts: 1

"use of undeclared identifier 'LINE_MAX'" while compiling pacman

I got this error when compiling pacman (make) on Android (Termux)...

make --no-print-directory all-recursive
Making all in lib/libalpm
Making all in po
make[3]: Nothing to be done for 'all'.
  CC       libalpm_la-add.lo
  CC       libalpm_la-alpm.lo
alpm.c:71:54: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
        sprintf(hookdir, "%s%s", myhandle->root, SYSHOOKDIR + 1);
                                                 ~~~~~~~~~~~^~~
alpm.c:71:54: note: use array indexing to silence this warning
        sprintf(hookdir, "%s%s", myhandle->root, SYSHOOKDIR + 1);
                                                            ^
                                                 &          [  ]
1 warning generated.
  CC       libalpm_la-alpm_list.lo
  CC       libalpm_la-backup.lo
  CC       libalpm_la-base64.lo
  CC       libalpm_la-be_local.lo
  CC       libalpm_la-be_package.lo
  CC       libalpm_la-be_sync.lo
  CC       libalpm_la-conflict.lo
  CC       libalpm_la-db.lo
  CC       libalpm_la-delta.lo
  CC       libalpm_la-deps.lo
  CC       libalpm_la-diskspace.lo
  CC       libalpm_la-dload.lo
  CC       libalpm_la-error.lo
  CC       libalpm_la-filelist.lo
  CC       libalpm_la-graph.lo
  CC       libalpm_la-group.lo
  CC       libalpm_la-handle.lo
  CC       libalpm_la-hook.lo
  CC       libalpm_la-ini.lo
  CC       libalpm_la-log.lo
  CC       libalpm_la-package.lo
  CC       libalpm_la-pkghash.lo
  CC       libalpm_la-rawstr.lo
  CC       libalpm_la-remove.lo
  CC       libalpm_la-signing.lo
  CC       libalpm_la-sync.lo
  CC       libalpm_la-trans.lo
  CC       libalpm_la-util.lo
util.c:664:13: error: use of undeclared identifier 'LINE_MAX'
                char ibuf[LINE_MAX];
                          ^
1 error generated.
make[3]: *** [Makefile:889: libalpm_la-util.lo] Error 1
make[2]: *** [Makefile:964: all-recursive] Error 1
make[1]: *** [Makefile:987: all-recursive] Error 1
make: *** [Makefile:896: all] Error 2

Can you fix the problem for me?
This is my configure log: https://pastebin.com/BtfKK9AU

Offline

#2 2019-06-25 10:19:55

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: "use of undeclared identifier 'LINE_MAX'" while compiling pacman

I guess that system does not define LINE_MAX anywhere.    Can you file a bug report in the big tracker?   Well get that fixed for the next release.


Edit: add "-DLINE_MAX=2048" to your CFLAGS to work around this.

Offline

Board footer

Powered by FluxBB