Some doubts about execline and skalibs

From: Alex Raschi <raschi.alex_at_gmail.com>
Date: Thu, 24 Dec 2020 14:38:04 +0100

Hi,

I created 2 openbsd ports for skalibs and execline and i'm going to
submit them as soon i tested them enough, i was wondering a few things:

I noticed that both skalibs and execline have -fno-stack-protector by
default, i haven't found anything related while searching commits or
mailing lists. Is this flag a left over or it's wanted?

Another thing i was wondering is why both packages put the shared
library under lib/ but the static one under lib/skalibs/ and
lib/execline/. If i leave libskarnet.a under lib/skalibs/, building
execline statically fails because it does not find libskarnet.a.

While execline built without warnings skalibs printed some, i think you
might find them useful so i'll leave them here (openbsd uses clang):

src/libstddjb/bitarray_clearsetn.c:11:55: warning: operator '<<' has lower precedence than '+'; '+' will be evaluated first [-Wshift-op-parentheses]
    unsigned char mask = (1 << (a & 7)) - 1 ^ (1 << 1 + (b-1 & 7)) - 1 ;
                                                 ~~ ~~^~~~~~~~~~~
src/libstddjb/bitarray_clearsetn.c:11:55: note: place parentheses around the '+' expression to silence this warning
    unsigned char mask = (1 << (a & 7)) - 1 ^ (1 << 1 + (b-1 & 7)) - 1 ;
                                                      ^
                                                    ( )
1 warning generated.

src/libstddjb/child_spawn1_internal.c:35:23: warning: & has lower precedence than !=; != will be evaluated first [-Wparentheses]
  if (p[to & 1] != to & 1)
      ~~~~~~~~~~~~~~~~^
src/libstddjb/child_spawn1_internal.c:35:23: note: place parentheses around the '!=' expression to silence this warning
  if (p[to & 1] != to & 1)
                      ^
      ( )
src/libstddjb/child_spawn1_internal.c:35:23: note: place parentheses around the & expression to evaluate it first
  if (p[to & 1] != to & 1)
                      ^
                   ( )
1 warning generated.

src/libstddjb/netstring_get.c:42:20: warning: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
    if (!n || n != size_scan(buf, &len)) return (errno = EPROTO, -1) ;
                   ^~~~~~~~~~~~~~~~~~~~
src/include/skalibs/types.h:213:43: note: expanded from macro 'size_scan'
#define size_scan(s, u) size_scan_base(s, (u), 10)
                                          ^~~
src/include/skalibs/uint64.h:48:57: note: passing argument to parameter here
extern size_t uint64_scan_base (char const *, uint64_t *, uint8_t) ;
                                                        ^
1 warning generated.

src/libstddjb/uint640_scan_base_max.c:9:1: warning: all paths through this function will call itself [-Winfinite-recursion]
{
^
1 warning generated.

Finally is there a way to set limits like with ulimit but without using
sh?

Thanks you for your projects, execline is awesome!

Cheers, Alex
Received on Thu Dec 24 2020 - 13:38:04 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC