Menu

#132 search include file path(s) before current work directory

open
nobody
None
1
2008-03-21
2008-03-21
No

Doing so allows -I to override files in the cwd.

This does break backwards compatibility -- so it may
not be desirable, or require a command line option.

Discussion

  • nasm64developer

    nasm64developer - 2008-03-21

    necessary changes

     
  • Anonymous

    Anonymous - 2008-03-22

    Logged In: YES
    user_id=73628
    Originator: NO

    I wouldn't mind a cl option and/or a directive, but, in addition to the problem of breaking existing code, I prefer the current behavior.

     
  • nasm64developer

    nasm64developer - 2008-03-22

    Logged In: YES
    user_id=804543
    Originator: YES

    A directive for selecting between "cwd first"
    and "path(s) first" won't be sufficient, since
    the -P option (which allows you to pre-include
    files) results in %INCLUDE directives -- they
    get processed before you could select.

    So you would need a command line option. I was
    too lazy to write that code... and too shy to
    pick a letter for it. :)

     
  • H. Peter Anvin

    H. Peter Anvin - 2008-03-22

    Logged In: YES
    user_id=58697
    Originator: NO

    I suggest an option to reset the include path, *including* the implicit leading "-I." From what I've seen, this is often written "-I-".

     
  • nasm64developer

    nasm64developer - 2008-03-23

    Logged In: YES
    user_id=804543
    Originator: YES

    The -I- used by GCC (-iquote actually, since -I- is
    deprecated) has two effects: it splits the list of
    include paths (#include "xx" vs #include <xx>), and
    it prevents the directory containing the current file
    from being searched.

    The former has no equivalent in NASM, and the latter
    is different (current file's vs CWD) from NASM.

    That said, NASM needs two command line options: one
    for controlling whether the CWD is searched first or
    last (this request) and one for controlling whether
    the CWD is searched at all (a Q4/2007 request).

    I have attached an additional set of changes.
    File Added: changes2.txt

     
  • nasm64developer

    nasm64developer - 2008-03-23

    additional changes

     
  • H. Peter Anvin

    H. Peter Anvin - 2008-03-23

    Logged In: YES
    user_id=58697
    Originator: NO

    No it doesn't, because once you have the former, the user can always add the CWD as an explicit option (-I or I./ or whatever is appropriate for their OS).

     

Log in to post a comment.