In a project I'm currently working on, I stat a file and use time functions. The stat structure requires that I use timespec structs for my time related file statistics, but I also need to use the current date to find out how long ago the file was created.
I can use the function time(struct time_t timeStruct) to put the current date into timeStruct, which is fine, however I cannot subtract a time_t from a timespec, so I must pass a timespec struct as the arg for time. This hasn't actually given me any trouble so far, but the compiler warns me against "passing args from incompatible pointer types", and I try to release finished programs with absolutely no warnings or problems anywhere.
Could someone show me how to rid my program of this error? I get it often enough in other programs as well, so it would be nice to know how to fix it.
EDIT: I should probably mention that I'm writing this tool in C as well
I can use the function time(struct time_t timeStruct) to put the current date into timeStruct, which is fine, however I cannot subtract a time_t from a timespec, so I must pass a timespec struct as the arg for time. This hasn't actually given me any trouble so far, but the compiler warns me against "passing args from incompatible pointer types", and I try to release finished programs with absolutely no warnings or problems anywhere.
Could someone show me how to rid my program of this error? I get it often enough in other programs as well, so it would be nice to know how to fix it.
EDIT: I should probably mention that I'm writing this tool in C as well