Code Monkey home page Code Monkey logo

Comments (9)

akacase avatar akacase commented on August 30, 2024

GCC 4.2.1 does not report this as an error in base OpenBSD. As more programs and ports are linted and eventually switched over to clang, the code will be changed. It's up to Ibara if he wants to diverge from the original OpenBSD source to accommodate these being reported as errors. I can prepare a pull request if you want.

from oksh.

hdatma avatar hdatma commented on August 30, 2024

Yes please.

Note: GCC does not report the errors because it does not make clang's extensive audit. The errors are still there, whether GCC reports them or not.

from oksh.

akacase avatar akacase commented on August 30, 2024

#6 addresses this issue.

from oksh.

hdatma avatar hdatma commented on August 30, 2024

Patches for

exec.c
expr.c
jobs.c
lex.c
main.c
misc.c
var.c

Results of compilation and comparison

>ls -l /bin/*sh     
-r-xr-xr-x  1 root  wheel   626272 Mar 23 00:57 /bin/bash
-rwxr-xr-x  1 root  wheel   375632 Mar 23 00:57 /bin/csh
-r-xr-xr-x  1 root  wheel  1377872 Mar 23 00:57 /bin/ksh
-rwxr-xr-x  1 root  wheel   354424 May  9 10:45 /bin/oksh
-r-xr-xr-x  1 root  wheel   630464 Mar 23 00:57 `/bin/sh`
-rwxr-xr-x  1 root  wheel   375632 Mar 23 00:57 /bin/tcsh
-rwxr-xr-x  1 root  wheel   592656 Mar 23 00:57 /bin/zsh

>otool -L /bin/oksh                                                                                                                                                                 
/bin/oksh:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)

How to use oksh as default shell (MacOS)

Go to System Preferences -> Users & Groups
Click the lock icon to unlock the preference pane
Right-click (or control-click) on the user and select "advanced options"
Change "login shell" to /bin/oksh.

oksh_patches.zip

from oksh.

akacase avatar akacase commented on August 30, 2024

hey @hdatma, when I get some time I can review these and create another pull request with these changes, but please be aware that most of openbsd isn't using C99 as a standard, most utils are still using ANSI C or C89 as the base. I think that we should fix errors/warnings (I think these reported are valid) that are discovered by clang, but while adhering to the standards (-std=c89 or -ansi) added to your compile will show errors/issues while not introducing code that could be troublesome to compile on platforms that don't have a C99+ compiler handy. Thanks!

from oksh.

akacase avatar akacase commented on August 30, 2024

#6 fixes all issues mentioned above in the patch.zip

from oksh.

hdatma avatar hdatma commented on August 30, 2024

Hey! OpenBSD is on track to replace gcc with clang. The two previous releases removed obsolete architectures on purpose, and the next release is said to include clang along with gcc.

from oksh.

hdatma avatar hdatma commented on August 30, 2024

I think we can close this issue, as all errors have been cleared with patches.

from oksh.

ibara avatar ibara commented on August 30, 2024

Closed.

from oksh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.