error accessing struct tm data from avr.libc time

Hit Quote on this post (lower right corner) to see what the code tags in the read me before posting here look like.

#include <time.h>                                        

void setup() {

  Serial.begin(115200);
  Serial.println(" ");
  set_system_time(3681359818 - NTP_OFFSET);  // >>> sample from NTP request just for testing
  set_zone(1 * ONE_HOUR);                           
  set_position (47.737591, 9.16148185);         
  
  Serial.print("sun rise: ");
  time_t sunRise = sun_rise(1);
  Serial.println(sunRise);                                    // result is: 1397800573

 
  Serial.print("year: ");
  
  Serial.println(tm.tm_year);

If you want to use a tm struct then you have to declare one, same as any other variable.

int x;
tm myTime;

Then you have to fill it and then you can use it in some time.h functions or do this:

Serial.println( myTime.tm_year); // myTime is the variable and tm is the variable type (a struct)

It's a big do-everything standard C library that you can find more about through a net-search.
http://www.nongnu.org/avr-libc/user-manual/group__avr__time.html#ga26c7d1dbf93fa8c23c5effbacec91f8c