Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4110127

(porting) Prototypes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.2.0
    • 1.1.6, 1.2.0
    • hotspot
    • 1.2fcs
    • generic, sparc
    • generic, solaris_2.5.1
    • Not verified

      Under ANSI C (not C++)
      int f1();
      is very different from
      int f1(void);

      declaration 1 declares function f1 without any prototypes, so can be called
      with any arguments.
      Declaration 2 declares function f2 with a prototype having no parameters,
      so can only be called with no arguments.
      Declaration 2 is still valid C++ code, so that is not a problem.

      There are many instances of this within the code, which generates extra
      warnings.

            never Tom Rodriguez
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: