Thread: confused

  1. #16
    Nonconformist Narf's Avatar
    Join Date
    Aug 2005
    Posts
    174
    Your quote is meaningless because we're not talking about a variable arguments function.
    I disagree. My quote is in reference to functions that accept a variable number of arguments, such as the way you use func1 and func2. You say you won't pass any arguments, but you pass 1 each. That falls under this clause, so your code is undefined. Unless you can tell me how to describe a function that accepts a variable number of arguments[1] without using an ellipsis and not showing how the function is called.
    In that case you must have a parameter before the ellipses is what that quote is saying.
    That quote doesn't say anything about a parameter. It talks about arguments, and there's no ambiguity when it comes to what an argument[1] is as opposed to what a parameter[2] is. The difference in meaning is in the details, and you have to go all over the place in the standard to get the whole story. I've done that.
    And where you have main() with the function's body that's a declaration.
    No, it's a definition. I think that's the subtle point that you're missing. A declaration is not a definition, but a definition is also a declaration, but the rules for a definition are different from a declaration, and they take precedence. In a declaration, f(void) and f() are not the same, but in a definition, f(void) and f() are the same. That's the point I'm clumsily trying to get across.
    You're saying that void and empty are not the same in that case so you're really saying I'm more correct, not Prelude, because that's what I was saying.
    Heheh, no. I'm saying that main(void) and main() are the same according to the C standard that I have sitting in front of me. However your implementation chooses to handle undefined behavior is beyond the scope of the standard, so your example is irrelevant, and your understanding of the issue is lacking, even though it really doesn't matter one way or the other whether you're right or I'm right...but professional arrogance says that I have to prove I'm right

    [1] Where 'argument' is very clearly defined as "expression in the comma-separated list bounded by the parentheses in a function call expression"
    [2] Where 'parameter' is also very clearly defined as "object declared as part of a function declaration or definition that acquires a value on entry to the function"
    Just because I don't care doesn't mean I don't understand.

  2. #17
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    it really doesn't matter one way or the other whether you're right or I'm right.
    You're absolutely correct. The purpose of my original post was just to clarify for the OP and other readers of the thread that putting void in the parameter list instead of leaving it empty makes a difference. Unfortunately, the thread turned into a technicality war.
    If you understand what you're doing, you're not learning anything.

  3. #18
    Super Moderater.
    Join Date
    Jan 2005
    Posts
    374
    One other technicality:


    Originally posted by Narf
    I can't assume to know what Prelude was really talking about, but as I understand it, he's right.
    Prelude is a she.

  4. #19
    Nonconformist Narf's Avatar
    Join Date
    Aug 2005
    Posts
    174
    Prelude is a she.
    I'm both surprised and not surprised. Thanks for the info.
    Just because I don't care doesn't mean I don't understand.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New to C++ and confused by boolean and ifs and else
    By jconner in forum C++ Programming
    Replies: 10
    Last Post: 08-02-2006, 03:29 AM
  2. Confused
    By jeev2005 in forum C Programming
    Replies: 5
    Last Post: 06-01-2006, 02:04 PM
  3. Confused
    By (TNT) in forum C# Programming
    Replies: 1
    Last Post: 11-23-2005, 04:49 PM
  4. confused.. in selecting my line of deapth
    By jawwadalam in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 05-04-2003, 01:21 PM
  5. Extern Question, really confused
    By SourceCode in forum C Programming
    Replies: 10
    Last Post: 03-26-2003, 11:11 PM