0

In a prototype line of a function

• the data type and the order of the parameters

• the data type of the return value

are defined. Having to hand this information the compiler is able to structure the lay out of the activation record. Is this true? Thanks in advance

ugurduzel
  • 1
  • 1
  • 5
    It appears the answer is "No" to the first question and "Yes" to the second question. See http://stackoverflow.com/questions/1266233/what-is-activation-record-in-the-context-of-c-and-c. – R Sahu Apr 26 '17 at 18:48
  • 1
    This is a platform-specific question. One can imagine platforms, for example, where locals are never stored on the stack and it's just used for parameters and returned values. – David Schwartz Apr 26 '17 at 18:51
  • @RSahu I have seen the same post but I wanted make sure so I asked specifically – ugurduzel Apr 26 '17 at 18:52
  • 3
    any type of treatment of local variables (or even global variables) is platform and ABI specific. – Ahmed Masud Apr 26 '17 at 18:56
  • 3
    Activation records is not a term used in C or C++ Standard. The question is moot. – SergeyA Apr 26 '17 at 18:59
  • @ugurduzel,if the other post does not answer any of your questions or doubts, please elaborate with addition information in your question. Otherwise, this post can be closed as a duplicate. – R Sahu Apr 26 '17 at 18:59
  • 1
    Why C++ tag for a C question? – chux - Reinstate Monica Apr 26 '17 at 19:00
  • Possible duplicate of [What is activation record in the context of C and C++?](http://stackoverflow.com/questions/1266233/what-is-activation-record-in-the-context-of-c-and-c) – user207421 Apr 26 '17 at 19:10
  • @DavidSchwartz I editted the most specific way I can. I am new to C I wasn't able to deduce directly. That is why I try to ask specifically. Please see the editted version – ugurduzel Apr 26 '17 at 21:28
  • @ugurduzel This is now a question about what "the compiler" is able to do without us having any idea what compiler we're talking about. – David Schwartz Apr 26 '17 at 22:03
  • @DavidSchwartz this is a previous exam question of ours compiler is gcc – ugurduzel Apr 26 '17 at 22:06
  • If this is a gcc question, you should tag it. – David Schwartz Apr 26 '17 at 22:10
  • @DavidSchwartz It wasn't specified as gcc in the question but we use gcc in the department. I dont even know if it was compiler dependent – ugurduzel Apr 26 '17 at 22:11
  • @DavidSchwartz why dont you answer the question if you know it so much, stop criticizing my wrong or missing expressions why do you all treat this way to a new comer look at the all comments above. – ugurduzel Apr 26 '17 at 22:18
  • @SergeyA the same with DavidSchwartz why dont you answer the question if you know it so much, stop criticizing my wrong or missing expressions why do you all treat this way to a new comer look at the all comments above. – ugurduzel Apr 26 '17 at 22:20
  • 2
    We can't answer the question until we know what the question is. The purpose of our comments is to get you to clarify the question. – David Schwartz Apr 26 '17 at 22:26
  • @DavidSchwartz This is the exact question nothing is missing actually they didnt even specify that the compiler is gcc. So is there anything left to answer the question? – ugurduzel Apr 26 '17 at 22:28

0 Answers0