This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 103694 - mfwiz: "Change" does not detect duplicate file name
Summary: mfwiz: "Change" does not detect duplicate file name
Status: RESOLVED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-10 22:19 UTC by htt
Modified: 2009-12-21 05:53 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description htt 2007-05-10 22:19:53 UTC
[ Originally filed by hlin ]

File > New Project > C/C++ Dev > C/C++ App (Application_1)
In Projects,
   right-click Application_1 > New > Makefile
   navigate to Enter Source Files panel
   Add source file "a.c"
   Add source file "b.c"
   in Source Files list, select "b.c" and rename it to "a.c"
   click Change
   -> duplicates of "a.c" now exist in the list.
   continue to finish the makefile
   -> observe in the generated makefile:
            OBJS_foo= \
                    $(TARGETDIR_foo)/a.o \
                    $(TARGETDIR_foo)/a.o
        
Seems duplicate file name is detected by Add but not by Change.  

On a side note, when Adding a duplicate file name, nothing happens, which is  
correct function-wise... but a msg at the bottom of the panel indicating a user
error would be more helpful.
Comment 1 htt 2007-05-11 00:36:02 UTC
A related case filed by soldatov emphasized the issue with makefile wizard
generating wrong code when the project includes two source files with the same
name.  The scenario:

o Create /tmp/1.c:
  //----------------------------
  int test123();
  int main() {
      return test123();
  }
  //----------------------------
o Create /tmp/folder/1.c:
  //----------------------------
  int test123() {
      return 1;
  }
  //----------------------------

o Launch the IDE
  File > New Project > C/C++ Dev > C/C++ App
    set Project Location = /tmp
    accept all other defaults; Finish
  In Projects,
    right-click Application_1 > New > Makefile
    navigate to Create List of Targets,
      Target Name = test
      select Executable (a.out)
      Add; Next; Next
    in Enter Source Files,
      browse to /tmp, select 1.c
      browse to /tmp/folder, select 1.c
      -> Source Files now show /tmp/1.c and /tmp/folder/1.c
    continue to Finish.
    right-click <makefile> and choose Make
    
==> Build failed.  Observe the following in the generated <makefile>:
--------------------------------------------
# Compile source files into .o files
$(TARGETDIR_test)/1.o: $(TARGETDIR_test) /tmp/1.c
        $(COMPILE.c) $(CFLAGS_test) $(CPPFLAGS_test) -o $@ /tmp/1.c

$(TARGETDIR_test)/1.o: $(TARGETDIR_test) /tmp/folder/1.c
        $(COMPILE.c) $(CFLAGS_test) $(CPPFLAGS_test) -o $@ /tmp/folder/1.c
--------------------------------------------
Comment 2 Thomas Preisler 2007-05-17 15:48:39 UTC
The makefile wizard is not part of the project system.
Comment 3 Quality Engineering 2009-12-21 05:53:42 UTC
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. 

We apologize for any inconvenience.


Thank you.
The NetBeans Team